PDA

View Full Version : Reset a variable upon changing a level?


wild8900
05-13-2008, 07:40 AM
From a weapon script, how would I efficiently change a client. variable back to 0 each time the player changes a level or reconnects?

Tigairius
05-13-2008, 07:41 AM
//#CLIENTSIDE
function onPlayerEnters() {
client.string = null;
}

DustyPorViva
05-13-2008, 07:41 AM
//#CLIENTSIDE
function onPlayerenters() {
// reset var here
}

onPlayerenters() works just as well in weapons as it does in levels :)

wild8900
05-13-2008, 07:55 AM
Awesome thanks alot. Should I feel stupid for not trying this? x3

Tigairius
05-13-2008, 07:57 AM
Awesome thanks alot. Should I feel stupid for not trying this? x3

I don't think so, not at all.

xXziroXx
05-13-2008, 02:02 PM
Awesome thanks alot. Should I feel stupid for not trying this? x3

client variables are changeable clientside and serverside, while clientr variables are changeable serverside and readable on clientside. :)

wild8900
05-13-2008, 06:59 PM
client variables are changeable clientside and serverside, while clientr variables are changeable serverside and readable on clientside. :)

Oh yes thats why I love client. variables. Great for storing temporary or non-vital variables that change a lot. Who cares if they can get hacked? If you change them you'll barely affect anything that I use them for... lol