Postado Janeiro 7, 2021 4 anos Rapaziada estou fazendo alguns testes em meu evento de boss porém percebi que se tiver um player no sqm onde o teleporte esta indicado para abrir, o evento buga e o tp não abre! "não da erro na distro" Tem como colocar alguma função para resolver isso? TFS 0.4 local function hasBoss() local id = getGlobalStorageValue("bossSys") if id ~= -1 then if isMonster(id) then return true else return false end end return false end local postp, postpentrada = {x = 129, y = 66, z = 7},{x = 62, y = 339, z = 7} local days = {"thursday"} function onTime() if isInArray(days, os.date("%A")) then if not hasBoss() then doCreateTeleport(1387, postpentrada, postp) local id = doCreateMonster("Boss Stremoxy", {x = 38, y = 340, z = 7}) setGlobalStorageValue("bossSys", id) doBroadcastMessage("O Boss Stremoxy nasceu! Corram para matar ele -> Teleporte no templo!") end end return true end function onThink(interval, lastExecution) if hasBoss() then doSendAnimatedText(postp, "Boss", 245) doSendMagicEffect(postp, 11) end return true end Editado Janeiro 7, 2021 4 anos por victor4312 (veja o histórico de edições)
Postado Janeiro 7, 2021 4 anos Solução local function hasBoss() local id = getGlobalStorageValue("bossSys") if id ~= -1 then if isMonster(id) then return true else return false end end return false end local postp, postpentrada = {x = 129, y = 66, z = 7},{x = 62, y = 339, z = 7} local days = {"thursday"} function onTime() if isInArray(days, os.date("%A")) then if not hasBoss() then local player = getTopCreature(postp).uid if player ~= 0 and isPlayer(player) then doTeleportThing(player, postpentrada) end doCreateTeleport(1387, postpentrada, postp) local id = doCreateMonster("Boss Stremoxy", {x = 38, y = 340, z = 7}) setGlobalStorageValue("bossSys", id) doBroadcastMessage("O Boss Stremoxy nasceu! Corram para matar ele -> Teleporte no templo!") end end return true end function onThink(interval, lastExecution) if hasBoss() then doSendAnimatedText(postp, "Boss", 245) doSendMagicEffect(postp, 11) end return true end
Postado Janeiro 8, 2021 4 anos Autor 7 horas atrás, Shiuns disse: local function hasBoss() local id = getGlobalStorageValue("bossSys") if id ~= -1 then if isMonster(id) then return true else return false end end return false end local postp, postpentrada = {x = 129, y = 66, z = 7},{x = 62, y = 339, z = 7} local days = {"thursday"} function onTime() if isInArray(days, os.date("%A")) then if not hasBoss() then local player = getTopCreature(postp).uid if player ~= 0 and isPlayer(player) then doTeleportThing(player, postpentrada) end doCreateTeleport(1387, postpentrada, postp) local id = doCreateMonster("Boss Stremoxy", {x = 38, y = 340, z = 7}) setGlobalStorageValue("bossSys", id) doBroadcastMessage("O Boss Stremoxy nasceu! Corram para matar ele -> Teleporte no templo!") end end return true end function onThink(interval, lastExecution) if hasBoss() then doSendAnimatedText(postp, "Boss", 245) doSendMagicEffect(postp, 11) end return true end perfeito meu querido, obrigado pela ajuda!
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.