![]() |
Scripting problems
Im trying to do some script for a NPC that reduces all damage done to in a pattern, first it does 0.5 then nothing then 0.5, so on and so forth my problem is that it only works for the first part of the script then stops. I was wondering if some one could help my and fix my script so that it would follow that pattern. Id really apreciate it.
i havent scipted in a while so that would explane why its so long. also when the NPC's activated it automaticly sets the players hearts to 3. if (test && playerhearts > 3 || playerhearts == 3 && this.l33t = 0) { playerhearts = 3; this.l33t = this.l33t + 1; } if (test && playerhearts > 3 && this.l33t = 1) { playerhearts = 2.5; this.l33t = this.l33t + 1; } if (test && playerhearts > 3 && this.l33t = 2) { playerhearts = 2.5; this.l33t = this.l33t + 1; } if (test && playerhearts > 3 && this.l33t = 3) { playerhearts = 2; this.l33t = this.l33t + 1; } if (test && playerhearts > 3 && this.l33t = 4) { playerhearts = 2; this.l33t = this.l33t + 1; } if (test && playerhearts > 3 && this.l33t = 5) { playerhearts = 1.5; this.l33t = this.l33t + 1; } if (test && playerhearts > 3 && this.l33t = 6) { playerhearts = 1.5; this.l33t = this.l33t + 1; } if (test && playerhearts > 3 && this.l33t = 7) { playerhearts = 1; this.l33t = this.l33t + 1; } if (test && playerhearts > 3 && this.l33t = 8) { playerhearts = 1; this.l33t = this.l33t + 1; } if (test && playerhearts > 3 && this.l33t = 9) { playerhearts = .5; this.l33t = this.l33t + 1; } if (test && playerhearts > 3 && this.l33t = 10) { playerhearts = .5; this.l33t = this.l33t + 1; } if (test && playerhearts > 3 && this.l33t = 11) { playerhearts = 0; this.l33t = this.l33t + 1; } if (test && this.l33t = 12) {unset test; this.l33t = 0;} |
lol i didnt know i could do that, lol. Hmm Visual Basic and G script are verry simmilar.
|
if(test){
for(this.i=0;playerhearts in |0,3|;this.i+2){ playerhearts-=.5; } unset test; } omg look how simple it can be... |
this doesnt work either:
if (playerhearts > 3 || playerhearts == 3 && this.l33t = 0) { playerhearts = 3; this.l33t = this.l33t + 1; } elseif (playerhearts > 3 && this.l33t = 1) { playerhearts = 2.5; this.l33t = this.l33t + 1; } elseif (playerhearts > 3 && this.l33t = 2) { playerhearts = 2.5; this.l33t = this.l33t + 1; } elseif (playerhearts > 3 && this.l33t = 3) { playerhearts = 2; this.l33t = this.l33t + 1; } elseif (playerhearts > 3 && this.l33t = 4) { playerhearts = 2; this.l33t = this.l33t + 1; } elseif (playerhearts > 3 && this.l33t = 5) { playerhearts = 1.5; this.l33t = this.l33t + 1; } elseif (playerhearts > 3 && this.l33t = 6) { playerhearts = 1.5; this.l33t = this.l33t + 1; } elseif (playerhearts > 3 && this.l33t = 7) { playerhearts = 1; this.l33t = this.l33t + 1; } elseif (playerhearts > 3 && this.l33t = 8) { playerhearts = 1; this.l33t = this.l33t + 1; } elseif (playerhearts > 3 && this.l33t = 9) { playerhearts = .5; this.l33t = this.l33t + 1; } elseif (playerhearts > 3 && this.l33t = 10) { playerhearts = .5; this.l33t = this.l33t + 1; } elseif (playerhearts > 3 && this.l33t = 11) { playerhearts = 0; this.l33t = this.l33t + 1; } elseif (playerhearts > 3 && this.l33t = 12) {unset test; this.l33t = 0;} } |
Quote:
|
dude do you see my post or not?
|
Quote:
|
lol np :D
|
gah i tried using your script and im stuck in a loop of death also by its self it didnt work.
|
oops i see why... playerhearts in |.5,3| that should work
|
ok, this script does a lot of f***** up thing...
one thing: NPC Code: |
Also just a suggestion, I would restrain from using numerical values in your variable names, just not a good idea.
|
Quote:
|
NPC Code: |
Quote:
NPC Code: |
this.l33t++;
|
umm here let me explane what i wanted better.
for everytime the player gets hurt the player will be delt nothing the first time then 0.5 the next time and it will continue in that patern till the player is dead. i hope i havent been too anoying in my request and i am very greatfull for evey posting some script here. |
Quote:
|
NPC Code: hows that?? |
Quote:
|
Thank you all so very much each one of you contributed to the end script and im very great full.
|
no problem bro
:p |
| All times are GMT +2. The time now is 06:43 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.