Assigning a Player a number

Hey everyone

Does anyone know how to assign a player a number, ie setting them to 1 and then running a function later saying if they = 1 do an action?



ply.number = 1

-- then later
if ply.number == 1 then
    -- something

Depends what you’re trying to do really, it might need networking

Yea, I am basically making it so vgui menu loads on players login, after selecting a choice they get set 1 or 0. Then later in another vgui menu, it run if player = 1 then code code code else code code code

Hope you can sort of understand what I mean


Yeah, I think the simple thing I posted before would work for that

[editline]7th May 2016[/editline]

You could just use local variables for that stuff though if all the code is in one file

Ok thank you, gonna try that out in a bit


Also if you’re only gonna use 0 and 1 I’d suggest using true and false