Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Help! (https://forums.graalonline.com/forums/showthread.php?t=53017)

falco10291029 06-06-2004 05:47 PM

Help!
 
In the following thread it is supposed to put an npc that puts explosions based on a players power(a custom string) but it always treats it as 0, can anyone see whats wrong?

______________________________________________
if (actionserverside) {;
putnpc2 strtofloat(#p(1)),strtofloat(#p(2)),{//creates the npc;
if (created||playerenters) {setimg shadoworb.png;//sets image as shadoworb.png

this.helth=1;//sets variable this.helth as 1;
setshape 1,50,50;//sets the size;
this.helth+=strtofloat(#p(0));//Problem 1:should add the amount of variable thing, but adds 0 instead;
for (i=0;this.helth>-1;i++) {
putexplosion2 10,strtofloat(#p(0))+1//Problem 2:explosion size should be the players power +1,x,y;
sleep 1;}}
if (wa****||wasshot) {this.helth-=1;
message #v(this.helth)}
if (this.helth<=-1) {putexplosion strtofloat(#p(0)),x,y;//Problem 3: when it dies, the explosion size should be players power, but it's 0;

destroy;//destroys the npc;}


}}
//#CLIENTSIDE
if (weaponfired) {
play shock.wav;
setplayerprop#c, Mine Power: #v(strtofloat(#s(client.playerpower)));//makes player say How powerful the mine will be based on their client.playerpower string
;thing=strtofloat(#s(client.playerpower));//creates variable thing with the value of the player's power;
triggeraction 0,0,serverside,Summoner,#v(thing),#v(playerx),#v(p layery);triggers the serverside action
}
__________________________________________________ __________

Loriel 06-06-2004 06:23 PM

I am certain it would help if you formatted your scripts like ~everybody else, and used a more informative thread title. Please do so.

falco10291029 06-06-2004 07:38 PM

I hardly have time for that, and you mean neaten and say what each part's supposed to do? fine ill edit it

GoZelda 06-06-2004 08:15 PM

Get the script redone by someone who's better and use the [CODE] tags please.

falco10291029 06-06-2004 09:26 PM

what [CODE] tags

GoZelda 06-06-2004 09:43 PM

By using [CODE]
NPC Code:
 and [\CODE] 

ofcourse. Except with a different slash.

Dach 06-07-2004 02:08 AM

I don't see where you're getting the parameters in the putnpc's script... not to mention that you're missing a parameter in your putnpc2, and some other issues I'll just assume are typos for simplicity's sake

falco10291029 06-08-2004 01:37 AM

er you cant use paramaters in putnpcs?

Dach 06-08-2004 05:16 PM

Quote:

Originally Posted by falco10291029
er you cant use paramaters in putnpcs?

syntax
putnpc2 imgname,x,y,{ script };

you only have two parameters before the script, and no you can't send parameters to the putnpc script, atleast not like that

hmm, I worded my other post kinda weird x_x

DarkShadows_Legend 06-09-2004 12:56 AM

Check your spelling and semicolons. Also check to see if you put in everything necessary, like the putexplosion2 doesn't look complete.

falco10291029 06-10-2004 05:48 PM

actually the parameters was the only real problem, except, why dont shootarrow and shootfireblast ect work in putnpcs?

VeX_RaT_Boy 06-10-2004 10:46 PM

becasue putnpcs are serverside (unless it joins a class).

darkreign3 06-10-2004 11:00 PM

LOL you need help man

VeX_RaT_Boy 06-10-2004 11:00 PM

Who needs help? me?

darkreign3 06-11-2004 12:48 AM

yup your right

falco10291029 06-11-2004 02:15 AM

im pretty sure he means me, and now i get the putnpc2 thing, lol sorry for being such...not good, but how do you use getplayer cus i need that for a weapon im making for me pw

darkreign3 06-11-2004 02:17 AM

First thing have you learned how to format a script?

VeX_RaT_Boy 06-11-2004 10:41 AM

Why do I need help?

Loriel 06-11-2004 05:22 PM

Thread is going nowhere. I will close this. Repost the script once it is actually readable so we can point out its flaws without getting our innocent eyes harmed by this script style of doom.


All times are GMT +2. The time now is 11:34 PM.

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