Postado Março 27, 2018 7 anos Galera, tenho um script aqui que leva o player para uma determinada posição se ele não responder o sistema, porém, se o player estiver em rookgard, ele é teletransportado para carlin, pq botei no script para ser teletransportado para o templo de Carlin! Deu para entender? Gostaria que o player fosse enviado para a cidade natal! script no creaturescripts: Spoiler local symbols = {"*", "^", "¿", "%", "&", "$"} local timeBetweenQuestion = 35 * 60 --35 minutes local timeToKick = 2 * 45 --1.5 minutes local timeStorage = 65117 local codeStorage = 65118 local kickStorage = 65119 local timesStorage = 65121 function onThink(cid, interval) if not isPlayer(cid) or getPlayerGroupId(cid) >= 3 then return end if getCreatureStorage(cid, timeStorage) < 1 then doCreatureSetStorage(cid, timeStorage, os.time() + timeBetweenQuestion) end if getCreatureStorage(cid, kickStorage) > 0 and os.time() >= getCreatureStorage(cid, kickStorage) then local tmp = {timeStorage, kickStorage, timesStorage, codeStorage} for i = 1, #tmp do doCreatureSetStorage(cid, tmp, 0) end return doTeleportThing(cid, {x = 26026, y = 26036, z = 5}) end if os.time() >= getCreatureStorage(cid, timeStorage) then local code, set = "", 0 set = math.random(1, 100000) local s, e = 1, 1 for i = 1, string.len(set) do code = (code == "" and string.sub(set, s, e) or code .. symbols[math.random(#symbols)] .. string.sub(set, s, e)) s, e = s + 1, e + 1 end doCreatureSetStorage(cid, codeStorage, set) doCreatureSetStorage(cid, kickStorage, os.time() + timeToKick) doCreatureSetStorage(cid, timeStorage, os.time() + timeBetweenQuestion) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[Anti-Bot]: Please say !antibot followed by your code without symbols.") doPlayerPopupFYI (cid, "Here is your code! !antibot"..code.." Type in the numbers without symbols.") end return end script no talkactions: Spoiler local codeStorage = 65118 local kickStorage = 65119 local timesStorage = 65121 local times = 3 function onSay(cid, words, param, channel) if getCreatureStorage(cid, codeStorage) == 0 then return doPlayerSendCancel(cid, "Not yet.") elseif tonumber(param) == tonumber(getCreatureStorage(cid, codeStorage)) then doCreatureSetStorage(cid, codeStorage, 0) doCreatureSetStorage(cid, kickStorage, 0) doCreatureSetStorage(cid, timesStorage, 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[Antibot]: Enjoy your time!") return true else if getCreatureStorage(cid, timesStorage) < 0 then doCreatureSetStorage(cid, timesStorage, 0) end doCreatureSetStorage(cid, timesStorage, getCreatureStorage(cid, timesStorage) + 1) if getCreatureStorage(cid, timesStorage) == times then doCreatureSetStorage(cid, codeStorage, 0) doCreatureSetStorage(cid, kickStorage, 0) doCreatureSetStorage(cid, timesStorage, 0) doTeleportThing(cid, {x = 26026, y = 26036, z = 5}) return true else return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[Antibot]: You have 3 total opportunities to try to get the correct answer.") end end return true end @Sttorm @MaTTch @Dwarfer
Postado Março 27, 2018 7 anos doTeleportThing(cid, {x = 26026, y = 26036, z = 5}) só você edita aqui {x = 26026, y = 26036, z = 5}) Editado Março 27, 2018 7 anos por Dragon Ball Hiper (veja o histórico de edições)
Postado Março 27, 2018 7 anos Solução local symbols = {"*", "^", "¿", "%", "&", "$"} local timeBetweenQuestion = 35 * 60 --35 minutes local timeToKick = 2 * 45 --1.5 minutes local timeStorage = 65117 local codeStorage = 65118 local kickStorage = 65119 local timesStorage = 65121 function onThink(cid, interval) if not isPlayer(cid) or getPlayerGroupId(cid) >= 3 then return end if getCreatureStorage(cid, timeStorage) < 1 then doCreatureSetStorage(cid, timeStorage, os.time() + timeBetweenQuestion) end if getCreatureStorage(cid, kickStorage) > 0 and os.time() >= getCreatureStorage(cid, kickStorage) then local tmp = {timeStorage, kickStorage, timesStorage, codeStorage} for i = 1, #tmp do doCreatureSetStorage(cid, tmp, 0) end return doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end if os.time() >= getCreatureStorage(cid, timeStorage) then local code, set = "", 0 set = math.random(1, 100000) local s, e = 1, 1 for i = 1, string.len(set) do code = (code == "" and string.sub(set, s, e) or code .. symbols[math.random(#symbols)] .. string.sub(set, s, e)) s, e = s + 1, e + 1 end doCreatureSetStorage(cid, codeStorage, set) doCreatureSetStorage(cid, kickStorage, os.time() + timeToKick) doCreatureSetStorage(cid, timeStorage, os.time() + timeBetweenQuestion) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[Anti-Bot]: Please say !antibot followed by your code without symbols.") doPlayerPopupFYI (cid, "Here is your code! !antibot"..code.." Type in the numbers without symbols.") end return end Nós somos aquilo que fazemos repetidamente. Excelência, não é um modo de agir, mas um hábito. Aristóteles
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.