PDA

View Full Version : I need help with adding a Mp Potion Script


Coolkid77742
02-05-2006, 03:04 AM
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
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:

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:

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.