Ir para conteúdo

(Resolvido)[GLOBALEVENTS] Tp não abre com player no sqm indicado!

Featured Replies

Postado

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 por victor4312 (veja o histórico de edições)

Resolvido por Shiuns

Ir para solução
Postado
  • 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
  • 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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo