Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   why wont this work? (https://forums.graalonline.com/forums/showthread.php?t=13366)

oscarjf1 09-30-2001 04:16 AM

why wont this work?
 
Has graal just decided to piss me off? I think so. This script used to ALWAYS work! No matter what, it would do what i wanted!
But now, it doesnt.

Script: Status Bar (Blah Blah Blah, saying i cant script a status bar is a waste of our time).

can someone debug this script for me? I can't seem to figure out what is wrong! When you get hurt, it doesnt work!

NPC Code:

// NPC made by War Lord Mpg2
if (playerenters) {
}
if (playertouchsme) {toweapons *Status; hidelocal; setstring client.bar1,warbar1.gif;
setstring client.bar2,warbar2.gif; set client.statson; timeout = .05;
}
//#CLIENTSIDE
if (timeout) {
if (client.statson) {
showimg 1111,#s(client.bar1),screenwidth-242,0; changeimgvis 1111,4;
changeimgvis 2222,4; changeimgvis 1111,4;
changeimgpart 2222,0,0,7*32*playerhearts/playerfullhearts,48;
if (playerhearts=playerfullhearts) {
showimg 2222,#s(client.bar2),screenwidth-242,0; changeimgvis 2222,4;
}
timeout = .05;
}
}
if (weaponfired) {set client.statson; setplayerprop #c,say "statsoff" to turn off;
timeout = .05; showstats 95+128+256+512+1024;
showimg 1111,#s(client.bar1),screenwidth-242,0; changeimgvis 1111,4;
showimg 2222,#s(client.bar2),screenwidth-242,0; changeimgvis 2222,4;
}
if (strequals(#c,statsoff)) {unset client.statson; sleep .2; hideimg 1111; hideimg 2222;
unset client.statson; showstats 95+128+256+512+1024+32;
}
if (playerdies) { showstats 95+128+256+512+1024;
}



Well?

oscarjf1 09-30-2001 04:36 AM

...
 
yes, feel free to post.

entravial 09-30-2001 04:40 AM

~AlphaFlame~

*runs by and puts post-its all over the place, then runs off into the monkey weed*

*calls back* I "post"ed. :D

btedji 09-30-2001 06:58 AM

i dont think you can do #clientside with weapons

btedji 09-30-2001 07:24 AM

Quote:

Originally posted by Kaimetsu
Use addweapon nowadays.
whats the difference between addweapon and toweapons?

btedji 09-30-2001 07:42 AM

Quote:

Originally posted by Kaimetsu


...(It's NPC Server only, though).

arg

Shard_IceFire 09-30-2001 08:25 AM

Whats wrong with it is that the index for the showimg is 2222 and I believe it only supports up to 400 or something.

btedji 09-30-2001 08:34 AM

Quote:

Originally posted by Shard_IceFire
Whats wrong with it is that the index for the showimg is 2222 and I believe it only supports up to 400 or something.
yes 400

oscarjf1 09-30-2001 11:58 AM

thanx
 
i will try that. Im too damned tired right now...ill try it tomorrow.

Cybnext_Design 09-30-2001 01:00 PM

Quote:

Originally posted by Shard_IceFire
Whats wrong with it is that the index for the showimg is 2222 and I believe it only supports up to 400 or something.
I have had an index of 900 before, so I doubt its 400.

Bhala 09-30-2001 08:23 PM

use 'while (client.statson)'.. if you use 'if (client.statson)' it will only work once....

Xaviar 10-01-2001 12:20 AM

Quote:

Originally posted by Bhala
use 'while (client.statson)'.. if you use 'if (client.statson)' it will only work once....
Wouldnt while be more laggy? (eg, resource hungry)?

oscarjf1 10-01-2001 01:21 AM

okay, im up
 
yes, the while statement isnt a very good thing to use. Anyways...i tried changing the numbers....and it worked! Thanx! even though, i decided to trash that whole script, and make a new one, which is like 5 times better, 1/2 the length, and took me 5 minutes to make. Thanx for your help!


All times are GMT +2. The time now is 05:45 AM.

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