Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Script For Forty-5 (https://forums.graalonline.com/forums/showthread.php?t=46454)

sYnergy247 07-24-2003 02:22 PM

Script For Forty-5
 
I can't figure out this script

//#CLIENTSIDE
if (created) {
// Initialize the attributes
showcharacter;
setcharprop #3,blue-head658.png;
setcharprop #C0,white;
setcharprop #C1,darkblue;
setcharprop #C2,darkblue;
setcharprop #C3,darkblue;
setcharprop #C4,darkblue;
setcharprop #2,no-shield.gif;
shieldpower = 1;
dir = 2;
message I like to get hit witch rocks and bushes and stuff so please do so!;
npcs[index].rupees ==100000l
}
if (waspelt) {
players[index].rupees +=1;
npcs[index].rupees -=1;
}

//added the npcs[index] in hope that it would show where the rupees came from but that did'nt work...On my server i will throw a bush at him and then it will show the rupee for half a second then it will dissapear...Please help

protagonist 07-24-2003 02:27 PM

Index is not a default variable. You don't need it. playerrupees will work for the player, and setting a this.rupees string for the NPC and modifying it will work for the NPC.

sYnergy247 07-24-2003 02:32 PM

:( i just started scripting...I don't really get what you mean..sorry

GoZelda 07-24-2003 02:39 PM

Instead of players[index].rupees, use playerrupees. Instead of npcs[index].rupees use this.rupees. That's what he said.

sYnergy247 07-24-2003 02:45 PM

dag...
 
Its still not working..

//#CLIENTSIDE
if (created) {
// Initialize the attributes
showcharacter;
setcharprop #3,blue-head658.png;
setcharprop #C0,white;
setcharprop #C1,darkblue;
setcharprop #C2,darkblue;
setcharprop #C3,darkblue;
setcharprop #C4,darkblue;
setcharprop #2,no-shield.gif;
shieldpower = 1;
dir = 2;
message I like to get hit witch rocks and bushes and stuff so please do so!;
this.rupees ==100000
}
if (waspelt) {
playerrupees +=1;
this.rupees -=1;
}

i changed the script to this....but it still does the same thing..Adds for a second then takes it away again..

Kaimetsu 07-24-2003 02:49 PM

this.rupees is a meaningless variable. You can't change player or NPC rupees on the clientside.

sYnergy247 07-24-2003 02:51 PM

so...
 
so how can i do this then? *bows down* please help me

Neoreno 07-24-2003 02:58 PM

Well, you can offline, however. The "==" is only used in checks. Use a single "=" when setting a variable.

sYnergy247 07-24-2003 03:00 PM

k thanks

sYnergy247 07-24-2003 03:15 PM

Server Options?
 
Could it not be working because of a server option that i have or don't have? I just got this server up yesterday...and this is the first time i've ever been in charge like this...is there anyway that the server options could be a problem?

Kaimetsu 07-24-2003 03:17 PM

It is not working because you cannot alter those variables on the clientside!

protagonist 07-24-2003 03:18 PM

You need to triggeraction.


All times are GMT +2. The time now is 02:37 PM.

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