I am trying to display a user's username in a panel. I'm using
[code]
function playerstats(ply)
local playername = ply:Nick()
draw.DrawText(playername, "DermaLarge", ScrW()/12, ScrH()/10, Color(255, 255, 255), TEXT_ALIGN_LEFT)
end
[/code]
When I open the panel In game, my console is spammed with
[code]
[ERROR] gamemodes/squadrush/gamemode/menus/cl_f2.lua:15: attempt to call method 'Nick' (a nil value)
1. unknown - gamemodes/squadrush/gamemode/menus/cl_f2.lua:15
[/code]
I don't know why this is not working.
The player passed to playerstats is nil
Nevermind, I just used for k,v in pairs (player.GetAll()) do.
Sorry, you need to Log In to post a reply to this thread.