Postado Abril 29, 2018 7 anos Olá Galera hj peço que me ajudem nisso por favor! Eu tenho um script e esse script ao usa 1 item chama um Protetor porem nesse mesmo script eu queria que ele tivesse algumas coisas tais como: - tempo que poderar usa o item novamente "sendo esse tempo podendo ser editado por eu ". - Nao poder usar tal item em area protection zone. Meu Script function onUse(cid, item, frompos, item2, topos) storage = 4191 storsol = 1203 if #getCreatureSummons(cid) > 1 then doPlayerSendCancel(cid,"Voce ja chamou seu Protetor!.") end if getPlayerStorageValue(cid,storsol) == 1 then local z = getCreatureSummons(cid)[1] addEvent(setPlayerStorageValue,100,cid,storsol,-1) doPlayerSay(cid,"Volte Protector!",TALKTYPE_ORANGE_1) doSendMagicEffect(getCreaturePosition(z), 2) doSendDistanceShoot(getCreaturePosition(z), getPlayerPosition(cid), 16) doRemoveCreature(z) end local summons = getCreatureSummons(cid) local pet = { ["Rinnegan [Protector]"] = {201,1000}, ["Rinnegan [Protector]"] = {201,1000} } for k,v in pairs(pet) do -- 1 if getPlayerStorageValue(cid,storsol) < 1 then if getPlayerLevel(cid) >= v[1] and getPlayerLevel(cid) < v[2] then -- 2 if (table.maxn(summons) < 1)then -- 3 x = doSummonCreature(k, getCreaturePosition(cid)) doConvinceCreature(cid, x) setPlayerStorageValue(cid,4194,1) setPlayerStorageValue(cid,storsol,1) doCreatureSay(cid, k ..", go!", TALKTYPE_ORANGE_1) doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 152) end end end end return true end Valendo 3 REP+ Editado Abril 30, 2018 7 anos por Jociel (veja o histórico de edições)
Postado Abril 29, 2018 7 anos Opa blz, veja se esse script atende suas necessidades: function onUse(cid, item, frompos, item2, topos) storage = 4191 storsol = 1203 tempo = 14400, --time com rolo que termina (em segundos 14400 = 4 horas) if #getCreatureSummons(cid) > 1 then doPlayerSendCancel(cid,"Voce ja chamou seu Protetor!.") end if getPlayerStorageValue(cid,storsol) == 1 then local z = getCreatureSummons(cid)[1] addEvent(setPlayerStorageValue,100,cid,storsol,-1) doPlayerSay(cid,"Volte Protector!",TALKTYPE_ORANGE_1) doSendMagicEffect(getCreaturePosition(z), 2) doSendDistanceShoot(getCreaturePosition(z), getPlayerPosition(cid), 16) doRemoveCreature(z) end local summons = getCreatureSummons(cid) local pet = { ["Rinnegan [Protector]"] = {201,1000}, ["Rinnegan [Protector]"] = {201,1000} } if ( isPlayerPzLocked(cid) ) and ( getPlayerStorageValue(cid, storsol) <= os.time() ) then for k,v in pairs(pet) do -- 1 if getPlayerStorageValue(cid,storsol) < 1 then if getPlayerLevel(cid) >= v[1] and getPlayerLevel(cid) < v[2] then -- 2 if (table.maxn(summons) < 1)then -- 3 x = doSummonCreature(k, getCreaturePosition(cid)) doConvinceCreature(cid, x) setPlayerStorageValue(cid,4194,1) setPlayerStorageValue(cid,storsol,1) setPlayerStorageValue(cid, storsol, os.time()+tempo) doCreatureSay(cid, k ..", go!", TALKTYPE_ORANGE_1) doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 152) end end end end end return true end
Postado Abril 29, 2018 7 anos Autor @Luis360 o Script parou de funcionar! Deu os Seguntes Erros [29/04/2018 18:51:24] [Error - LuaScriptInterface::loadFile] data/actions/scripts/bonus/mystic protector.lua:7: unexpected symbol near 'if' [29/04/2018 18:51:24] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/bonus/mystic protector.lua) [29/04/2018 18:51:24] data/actions/scripts/bonus/mystic protector.lua:7: unexpected symbol near 'if' Editado Abril 29, 2018 7 anos por Jociel Devidos erros (veja o histórico de edições)
Postado Abril 30, 2018 7 anos 15 horas atrás, Jociel disse: @Luis360 o Script parou de funcionar! Deu os Seguntes Erros [29/04/2018 18:51:24] [Error - LuaScriptInterface::loadFile] data/actions/scripts/bonus/mystic protector.lua:7: unexpected symbol near 'if' [29/04/2018 18:51:24] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/bonus/mystic protector.lua) [29/04/2018 18:51:24] data/actions/scripts/bonus/mystic protector.lua:7: unexpected symbol near 'if' Ops falha minha, na parte que está a variavel tempo , tem uma virgula, é só retirar ela. function onUse(cid, item, frompos, item2, topos) storage = 4191 storsol = 1203 tempo = 14400 --time com rolo que termina (em segundos 14400 = 4 horas) if #getCreatureSummons(cid) > 1 then doPlayerSendCancel(cid,"Voce ja chamou seu Protetor!.") end if getPlayerStorageValue(cid,storsol) == 1 then local z = getCreatureSummons(cid)[1] addEvent(setPlayerStorageValue,100,cid,storsol,-1) doPlayerSay(cid,"Volte Protector!",TALKTYPE_ORANGE_1) doSendMagicEffect(getCreaturePosition(z), 2) doSendDistanceShoot(getCreaturePosition(z), getPlayerPosition(cid), 16) doRemoveCreature(z) end local summons = getCreatureSummons(cid) local pet = { ["Rinnegan [Protector]"] = {201,1000}, ["Rinnegan [Protector]"] = {201,1000} } if ( isPlayerPzLocked(cid) ) and ( getPlayerStorageValue(cid, storsol) <= os.time() ) then for k,v in pairs(pet) do -- 1 if getPlayerStorageValue(cid,storsol) < 1 then if getPlayerLevel(cid) >= v[1] and getPlayerLevel(cid) < v[2] then -- 2 if (table.maxn(summons) < 1)then -- 3 x = doSummonCreature(k, getCreaturePosition(cid)) doConvinceCreature(cid, x) setPlayerStorageValue(cid,4194,1) setPlayerStorageValue(cid,storsol,1) setPlayerStorageValue(cid, storsol, os.time()+tempo) doCreatureSay(cid, k ..", go!", TALKTYPE_ORANGE_1) doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 152) end end end end end return true end
Postado Abril 30, 2018 7 anos Autor @Luis360 vo testa jaja digo o resultado Edit: Eu testei e deu o seguinte erro [30/04/2018 09:58:26] [Error - LuaScriptInterface::loadFile] data/actions/scripts/bonus/mystic protector.lua:27: ')' expected near 'ï' [30/04/2018 09:58:26] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/bonus/mystic protector.lua) [30/04/2018 09:58:26] data/actions/scripts/bonus/mystic protector.lua:27: ')' expected near 'ï' @Luis360 Editado Abril 30, 2018 7 anos por Jociel Edit (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.