Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   I need help with adding a Mp Potion Script (https://forums.graalonline.com/forums/showthread.php?t=63931)

Coolkid77742 02-05-2006 03:04 AM

I need help with adding a Mp Potion Script
 
Ok I need a Script kinda like a mp pot that adds mp... then destroys im trying
//#CLIENTSIDE
if (weaponfired) playermp += +60; destroy; .... but then the mp adds when its fired then it dissapears

napo_p2p 02-05-2006 03:13 AM

You need to have playermp changed serverside.

Use triggeraction.

Lance 02-05-2006 03:13 AM

Quote:

Originally Posted by Coolkid77742
Ok I need a Script kinda like a mp pot that adds mp... then destroys im trying
//#CLIENTSIDE
if (weaponfired) playermp += +60; destroy; .... but then the mp adds when its fired then it dissapears

First, you'll want it to be:

NPC Code:
playermp += 60;



and not += +60.

Second, if you want more than one line of code to be executed if that if statement evaluates as true, you're going to want to make use of braces, such as { and }.

Example:

NPC Code:
if (condition) {
var1 = "blue"; // Line 1
var2 = 3; // Line 2
}



Third (as Napo posted), you should probably be changing the playermp/player.mp variable serverside.

Please refer to KSI-GS in the main scripting forum's advice thread. Also, you probably posted this thread in the wrong forum. This forum is for GS2-specific questions, and not only is your code entirely GS1 but your question has nothing to do with the new scripting engine.


All times are GMT +2. The time now is 12:42 PM.

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