@mudrock Boa tarde mano , sera que teria como por um intervalo nesse seu script? tipo de 30 segundos , para que o player nao fique entrando e saindo da area de proteçao e fique toda hora aparecendo a mensagem? vlw desde de ja
.
- Forums
- OTServ
- Recursos
- Scripting
- Globalevents e Spells
- [TFS 0.4/0.3.6] Aviso de bless ao sair da zona de proteção.
[TFS 0.4/0.3.6] Aviso de bless ao sair da zona de proteção.
By Mudrock, 11 de jul. de 2015 in Globalevents e Spells
info
Group: Artesão
Joined: 13/07/11
Posts: 104
Reputation: +4
Tibia Character: Willliam Serravalle

info
Group: Visconde
Joined: 11/04/15
Posts: 351
Reputation: +205
Gender: Masculino

<globalevent name="Bless" interval="30000" script="bless.lua"/>
function onThink(interval, lastExecution)
local players = {}
for _, cid in pairs(getPlayersOnline()) do
if getPlayerBlessing(cid, 1) and getPlayerBlessing(cid, 2) and getPlayerBlessing(cid, 3) and getPlayerBlessing(cid, 4) and getPlayerBlessing(cid, 5) then
table.insert(players, cid)
elseif (getTilePzInfo(getCreaturePosition(cid))) == false then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"VOCE NAO TEM BLESS CUIDADO.")
end
end
return TRUE
end
tente assim por globalevents e mais pratico.


info
Group: Marquês
Joined: 24/12/09
Posts: 1k
Reputation: +326
Gender: Masculino
Tibia Character: Necromanser
.Informações
.Em "Data/creaturescripts/scripts", copie e cole um arquivo.LUA e renomeie para checkBless.lua, apague tudo e cole:
function onThink(cid, lastExecution, thinkInterval) if(getTilePzInfo(getCreaturePosition(cid))) == false and getPlayerStorageValue(cid, 23333) <= 0 then for b = 1,5 do if getPlayerBlessing(cid, b) == false then setPlayerStorageValue(cid, 23333, 1) return doPlayerSendTextMessage(cid, 22, "Você não tem todas as bless, tome cuidado.") end end elseif (getTilePzInfo(getCreaturePosition(cid))) == true and getPlayerStorageValue(cid, 23333) == 1 then setPlayerStorageValue(cid, 23333, -1) end return true end.Em "Data/creaturescripts", abra o creaturescripts.xml e adicione:
.Novamente em "Data/creaturescripts/scripts", abra o arquivo login.lua e adicione:
Créditos: ScythePanthom and wakon