Null value, ply?


function changejob( paycheck, number, ply )
 
 ply:SetNetworkedInt( "paycheck", paycheck )    <---- line 72
 ply:SetTeam( number )
 
end

Gave me this error?


[gamemodes\legendscript\gamemode\init.lua:72] attempt to index local 'ply' (a nil value)(Hook: PlayerInitialSpawn)

Help please!

the specified player does not exist… Be sure you are giving the function valid values.

Where are you calling it from?

Either you have no Idea what you are doing, or you messed/missed a/with the variable/s

Commander - I never actually wrote the hook, I just called it under the function GM:PlayerInitialSpawn( ply )

Ralle - I think what your asking is where do I actually run the function, and that is in GM:PlayerInitialSpawn( ply )

Wizard - Please explain!

Post your PlayerInitialSpawn hook then

changejob( 50, 1 )

Is that what you asked for? Thats the code inside of GM:PlayerInitialSpawn

changejob( 50, 1, ply )

Ugh, thanks. I really need a dumbass filter! XD