Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   This. Problem (https://forums.graalonline.com/forums/showthread.php?t=18443)

SSRobgeta 12-07-2001 09:11 AM

This. Problem
 
I am having a problem with This. command. I made a script where you have this.something=100. Then it goes down every 1 % every 2 mins. But when I use something to make it go up like this.something=this.something+5 it doesn't work. I tried Strings, but that doesn't work either. Please Help.

nyghtGT 12-07-2001 09:58 AM

Re: This. Problem
 
Quote:

Originally posted by SSRobgeta
I am having a problem with This. command. I made a script where you have this.something=100. Then it goes down every 1 % every 2 mins. But when I use something to make it go up like this.something=this.something+5 it doesn't work. I tried Strings, but that doesn't work either. Please Help.
i now your not a complete fool but i am just making sure you realize that this.varables only pertain to th NPC they are set on ...

SSRobgeta 12-07-2001 10:13 AM

but when I did just strings once it didn't work

SSRobgeta 12-07-2001 10:24 AM

Ok nyght help me. I screwed up this script bad. It was working at first then it screwed up on me.
//Created by Rob Getshu (Food Status)
if (playertouchsme) {
toweapons *Food Bar;
timeout=6;
setstring foodenergy,#v(strtofloat(#s(foodenergy))+100);
}
if (created && isweapon) {
timeout=6;
}
if(weaponfired){
if(strtofloat(#s(foodenergy))=>80){
setani bloated,;
}
if(strtofloat(#s(foodenergy))<=79 && strtofloat(#s(foodenergy))>=60){
setani fine,;
}
if (strtofloat(#s(foodenergy))=<59 && strtofloat(#s(foodenergy))>=40) {
setani nothungry,;
}
if (strtofloat(#s(foodenergy))=< 39 && strtofloat(#s(foodenergy))>=20) {
setani hungry,;
}
if (strtofloat(#s(foodenergy))=< 19 && strtofloat(#s(foodenergy))>=0) {
setani starving,;
}
setplayerprop#c, #s(foodenergy/100*100)%;
freezeplayer .6;
}

if(timeout){
if(strtofloat(#s(foodenergy))>0){
foodenergy--;
}
if (strtofloat(#s(foodenergy))=<0) {
disableweapons
}
if(strtofloat(#s(foodenergy))=>0){
enableweapons
}
}
timeout=6;

//banana
// NPC made by Rob Getashu
timeout=1;
if (timeout) {
message Banana;
sleep 1;
message 5 G;
timeout=1;
}
if (playerchats&&strequals(#c,banana)&&playerrupees=> 0) {
toweapons Banana;
playerrupees=playerrupees-5;
}
if (weaponfired) {
setani eatbanana,;
strtofloat(#s(foodenergy)) = strtofloat(#s(foodenergy))+5;
}


All times are GMT +2. The time now is 10:36 AM.

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