Ae pessoal estou com um script de castle 24h, que quando uma guild mata um monstro ela ganha a storage 98741.
o script esta quase perfeito unico erro do script é que quando uma guild mata o monstro não remove a storage da guild anterior e não manda um brodcast para todo o ot avisando que dominaram o castle.
function haveCastleEventWinner()
local a = 0
for i,x in pairs(GuildCastleScore) do
a = a+x
end
return a >= 1
end
function getGuildCastleEventWinner()
local bestscore = 0
for i,x in pairs(GuildCastleScore) do
if x > bestscore then
bestscore = x
GuildWinner = i
end
end
return GuildWinner
end
function onKill(cid, target)
if getCreatureName(target) == "Castle Generator" then
GuildCastleScore[getPlayerGuildName(cid)] = GuildCastleScore[getPlayerGuildName(cid)] and GuildCastleScore[getPlayerGuildName(cid)]+1 or 1
if haveCastleEventWinner() then
doBroadcastMessage("[Castle_Event] A Guild " .. getGuildCastleEventWinner().. " dominou o castelo.")
GuildCastleScore = {}
end
end
end
return TRUE
end
info
Grupo: Campones
Registrado: 24/08/15
Posts: 23
Reputação: 0
Ae pessoal estou com um script de castle 24h, que quando uma guild mata um monstro ela ganha a storage 98741.
o script esta quase perfeito unico erro do script é que quando uma guild mata o monstro não remove a storage da guild anterior e não manda um brodcast para todo o ot avisando que dominaram o castle.
function haveCastleEventWinner() local a = 0 for i,x in pairs(GuildCastleScore) do a = a+x end return a >= 1 end function getGuildCastleEventWinner() local bestscore = 0 for i,x in pairs(GuildCastleScore) do if x > bestscore then bestscore = x GuildWinner = i end end return GuildWinner end function onKill(cid, target) if getCreatureName(target) == "Castle Generator" then GuildCastleScore[getPlayerGuildName(cid)] = GuildCastleScore[getPlayerGuildName(cid)] and GuildCastleScore[getPlayerGuildName(cid)]+1 or 1 if haveCastleEventWinner() then doBroadcastMessage("[Castle_Event] A Guild " .. getGuildCastleEventWinner().. " dominou o castelo.") GuildCastleScore = {} end end end return TRUE endAjudem ? Preciso Urgente !