Hello, its again me ;x im trying to make as title sais make few winners at event, but to be honest i dont undestand this function and how to remake it so i need small help/tips.
Tried adding other if for player storage etc but as i guess even if i had good idea i screwd something cuz i cant understand that function so i need small help,
usually had errors with creature not found ;/
tfs 0,4 client 8,6
Trying to remake script from:
Or maybe better to add new query with some edits? im getting idiot already of that, i just want to make event which on each kill give +x point depends on monster etc, and at the end to have few winners depended on score, help?
Code:
function winMonsterEvent()
local max_sto, winner = 0, 0
local monster = getGlobalStorageValue(1919211)
for _, pid in pairs(getPlayersOnline()) do
local sto = getPlayerStorageValue(pid, 1814210)
if sto > max_sto then
max_sto = sto
winner = pid
end
end
if isPlayer(winner) then
local artigo = getPlayerSex(winner) == 0 and "A jogadora" or "O jogador"
doBroadcastMessage(artigo.." "..getCreatureName(winner).." matou "..getPlayerStorageValue(winner, 1814210).." "..monster.."s e venceu o evento, parabens!")
for _, prize in pairs(premios) do
doPlayerAddItem(winner, prize[1], prize[2])
end
doPlayerAddMoney(winner, gold)
else
doBroadcastMessage("[Monster Hunter Event] O evento terminou e nao houve nenhum vencedor.")
end
setGlobalStorageValue(1919211, 0)
end
Tried adding other if for player storage etc but as i guess even if i had good idea i screwd something cuz i cant understand that function so i need small help,
usually had errors with creature not found ;/
tfs 0,4 client 8,6
Trying to remake script from:
Monster Hunter Event
www.xtibia.com
Or maybe better to add new query with some edits? im getting idiot already of that, i just want to make event which on each kill give +x point depends on monster etc, and at the end to have few winners depended on score, help?