How to set a var on a Player?

Hello Facepunch,

I’m wondering if anyone could help me on how i can set some sort of varible onto a player, this’ll help me with a addon I’m making for an example i could do like
if the player isCooldown ( if the player is on cooldown) then do whatever… but I’d want it so it sets on every individual person, as I mean if one person gets cooldown it doesn’t mean everyone will get it.

Hopefully someone can help, thank you.

when you run the function that shall set the cooldown, simply add it to the players table like,

ply.cooldown = true

and then you can access it for that player, and its not shared, its individual to each player.

If you want to set a variable that is accessible from both server and client, then use

ply:SetNWBool (or the other types). If you just want it to be on the server, whitestar’s post is the way to go.

So if I do inside the hook for an example plr.iswaiting = false that’ll assign iswaiting to the player right?

[editline]18th April 2016[/editline]

Thanks, I’ll try your method out.

Yes. An easy way to understand it is to think about players like tables, you can store things in them.

If anyone is willing to guide me, could you add me on Steam please.