Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Reset a variable upon changing a level? (https://forums.graalonline.com/forums/showthread.php?t=79722)

wild8900 05-13-2008 07:40 AM

Reset a variable upon changing a level?
 
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

PHP Code:

//#CLIENTSIDE
function onPlayerEnters() {
  
client.string null;



DustyPorViva 05-13-2008 07:41 AM

PHP Code:

//#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

Quote:

Originally Posted by wild8900 (Post 1390614)
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

Quote:

Originally Posted by wild8900 (Post 1390614)
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

Quote:

Originally Posted by xXziroXx (Post 1390634)
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


All times are GMT +2. The time now is 09:20 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.