Postado Dezembro 28, 2017 7 anos Solução Configs = { RestrictNames = {"gm fulano de tal"} -- lista de nomes proibidos para se usar /goto } local function tableContains(table, value) for index = 1, #table do if table[index]:lower() == value:lower() then return true end end end function onSay(cid, words, param) local player = Player(cid) if getPlayerGroupId(cid) > 3 then local target = Creature(param) if target == nil or tableContains(Configs.RestrictNames, player:getName()) then player:sendCancelMessage("Creature not found.") return false end player:teleportTo(target:getPosition()) return false end end Configs = { RestrictNames = {"gm fulano de tal"} } local function tableContains(table, value) for index = 1, #table do if table[index]:lower() == value:lower() then return true end end end function onSay(player, words, param) if not player:getGroup():getAccess() then return true end local creature = Creature(param) if not creature or tableContains(Configs.RestrictNames, player:getName()) then player:sendCancelMessage("A creature with that name could not be found.") return false end local oldPosition = creature:getPosition() local newPosition = creature:getClosestFreePosition(player:getPosition(), false) if newPosition.x == 0 then player:sendCancelMessage("You can not teleport " .. creature:getName() .. ".") return false elseif creature:teleportTo(newPosition) then if not creature:isInGhostMode() then oldPosition:sendMagicEffect(CONST_ME_POFF) newPosition:sendMagicEffect(CONST_ME_TELEPORT) end end return false end https://github.com/Cjaker/ , _ , ( o o ) /'` ' `'\ ESTOU TE OBSERVANDO O_O |'''''''| |\\'''//| """
Postado Janeiro 7, 2018 7 anos Autor @Ckfox [Warning - Event::checkScript] Can not load script: scripts/teleport_to_creature.lua data/talkactions/scripts/teleport_to_creature.lua:19: 'then' expected near 'player'@Cjaker Amor, não deu boa, ele continua aceitando o TP
Postado Janeiro 8, 2018 7 anos @Andreeyyy function onSay(cid, words, param) local restricao = {"Demon","Fire Devil"} for r = 1, #restricao do if param == restricao[r]then player:sendCancelMessage("Você não pode usar isto diga /goto restricao") return true end if param == "restricao" then player:sendCancelMessage(restricao[r]) return true end local player = Player(cid) if getPlayerGroupId(cid) > 3 then local target = Creature(param) if target == nil then player:sendCancelMessage("Creature not found.") return false end player:teleportTo(target:getPosition()) return false end end end ---------------------------------------------------------------------------------------- function onSay(player, words, param) local restricao = {"Demon","Fire Devil"} for r = 1, #restricao do if param == restricao[r]then player:sendCancelMessage("Você não pode usar isto diga /c restricao") return true end if param == "restricao" then player:sendCancelMessage(restricao[r]) return true end if not player:getGroup():getAccess() then return true end local creature = Creature(param) if not creature then player:sendCancelMessage("A creature with that name could not be found.") return false end local oldPosition = creature:getPosition() local newPosition = creature:getClosestFreePosition(player:getPosition(), false) if newPosition.x == 0 then player:sendCancelMessage("You can not teleport " .. creature:getName() .. ".") return false elseif creature:teleportTo(newPosition) then if not creature:isInGhostMode() then oldPosition:sendMagicEffect(CONST_ME_POFF) newPosition:sendMagicEffect(CONST_ME_TELEPORT) end end return false end end Editado Janeiro 8, 2018 7 anos por Ckfox (veja o histórico de edições) Ajudei? REP+ Meus Servers: PokeUnwind Em Breve Rust Tibia Fechado Tópicos: [Tutorial] Adicionando Pokemons com icon system [Solução] ElfBot não abre corpos Projetos: DigiTibia Fechado Rust Tibia Fechado(temporariamente!)
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.