Can somone please explain functions to me, im trying to learn lua but failing.
[lua]function playername(ply)
ply:ChatPrint(ply:Name())
end
[/lua]
I understand you call the function using playername() but dont understand ply bit, and i see it used frequently when looking at existing lua. When i run the script calling it using playername() it gives me this error
:2: attempt to index local ‘ply’ (a nil value).