Quote:
Originally Posted by Gunderak
so somthing like the first bit then
if player.rupees <=1000;
triggerserver blah blah blah;
}
else {
player.chat = "I Dont Have Enough Money!";
return;
would that do it?
|
No, it wouldn't. Please use PHP tags when posting code in the future.
PHP Code:
if player.rupees <=1000;
triggerserver blah blah blah;
} else {
player.chat = "I Dont Have Enough Money!";
return;
The first line is of an if-statement does not need a semicolon as it is not a command, it's a condition.
If you'd read the guide linked to you, you'd see that the proper syntax for an if-else statement is:
PHP Code:
if (condition) {
// do something
} else {
// do something else
}
Your condition was backwards.
player.rupees <= 1000 would be true if they had less than or equal to 1000, so change it to
player.rupees >= 1000 and plug that in:
PHP Code:
if (player.rupees >= 1000) {
// do something
} else {
// do something else
}
Now all you have to do is either add the weapon or set the player's chat.
PHP Code:
if (player.rupees >= 1000) {
player.addWeapon("Hats/Dino Hat");
} else {
player.chat = "You don't have enough money!";
}
You don't need a trigger as you should be doing this serverside.