• player, localplayer, ply
    3 replies, posted
Hello, I'm trying to understand Lua better, but I always get's confused about this: When do you use player, LocalPlayer or ply? And is it better to use ply instead of player? (read that somewhere) *** prepares for dumb ratings.
LocalPlayer() = a function that gets the player (only works clientside) the player and ply are just different variable names, you could name them anything you like.
snip
You use LocalPlayer() when you're on a clientside script and you want to get the player you're controlling. player is the library of player-related functions eg player.GetAll(). ply is a common variable name for a player object used in hooks and console commands. As quincy said, it's just a convention - you could call your player variables "asdf" or "grandtheftauto" if you like - but that would be bad practice since it doesn't give you an idea of what the variable represents.
Sorry, you need to Log In to post a reply to this thread.