Hello there,
I made GUI for userpanel and I wanted to make a function where players can see their stats when they open it. As first I'm trying to make kills, but there's an error. This is how it looks now:
Clientside:
function callServerFunction(funcname, ...)
local arg = { ... }
if (arg[1]) then
for key, value in next, arg do
if (type(value) == "number") then arg[key] = tostring(value) end
end
end
triggerServerEvent("kills123", resourceRoot , funcname, unpack(arg))
end
guiSetText ( killslabel, "Kills: "..callServerFunction("kills").."")
Serverside:
function kills(v)
for i, v in pairs ( getElementsByType ( "player" ) ) do
local theAcc = getPlayerAccount(v)
if theAcc and not isGuestAccount(theAcc) then
return tostring(getAccountData ( theAcc, "Info.Kills" ))
else
return "0"
end
end
end
addEvent("kills123", true)
addEventHandler("kills123", resourceRoot, kills)
And error: Attempt to concatenate a nil value (line with guiSetText)