hey, i've got a strange problem updating a gui label with a data i get from server side O_o, here is my code and the error i'm genting.
client:
function upClientStats(zombiekills,deaths)
if deaths == 0 then
guiSetText(ratioLabel, "Ratio: N/A")
else
ratio = (tonumber(zombiekills)/tonumber(deaths))*10
guiSetText(ratioLabel, "Ratio: "..tostring(ratio).." %")
end
end
addEvent("updateClientStatsGui", true)
addEventHandler("updateClientStatsGui", getRootElement(), upClientStats)
server:
function info2(cliente)
local account = getPlayerAccount (cliente);
if not isGuestAccount(account) then
local zombiekills = getAccountData(account,"zombieKills")
local deaths = getAccountData(account,"deaths")
triggerClientEvent (cliente,"updateClientStatsGui",cliente,zombiekills,deaths)
end
end
addEvent("getInfoFromClient", true)
addEventHandler("getInfoFromClient", getRootElement(), info2)
Error: attempt to perfrom arithmetic on a nil value its at zombiekills if i'm right.
Thanks in advance