Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Food Status (https://forums.graalonline.com/forums/showthread.php?t=15222)

SSRobgeta 10-23-2001 02:40 AM

Food Status
 
Hey can someone help? I wanna make this so it goes down slowly and it shows the percent your hungry. Look and see...

// NPC made by Rob Getashu
if (playertouchsme) {
toweapons Food Bar;
}
if (created) {
set foodbargodown;
foodpower = this.foodenergy
}
if (isweapon && this.foodenergy=100) {
this.foodenergy++;
setplayerprop#c, #v(this.foodenergy/100*100)%;
freezeplayer .6
}
if (this.foodenergy=>80&&weaponfired) {
setani bloated,;
setplayerprop#c, #v(this.foodenergy/100*100)%;
freezeplayer .6
}
if (this.foodenergy=<60>79&&weaponfired) {
setani fine,;
setplayerprop#c, #v(this.foodenergy/100*100)%;
freezeplayer .6
}
if (this.foodenergy=<40>59&&weaponfired) {
setani nothungry,;
setplayerprop#c, #v(this.foodenergy/100*100)%;
freezeplayer .6
}
if (this.foodenergy=<20>39&&weaponfired) {
setani hungry,;
setplayerprop#c, #v(this.foodenergy/100*100)%;
freezeplayer .6
}
if (this.foodenergy=<20>39&&weaponfired) {
setani starving,;
setplayerprop#c, #v(this.foodenergy/100*100)%;
freezeplayer .6
}
if (this.foodenergy=<0) {
disableweapons
}
if (this.foodenergy=>0) {
enableweapons
}

btedji 10-23-2001 03:10 AM

use arrays

SSRobgeta 10-23-2001 03:28 AM

Quote:

Originally posted by btedji
use arrays
Thank you for helping?

btedji 10-23-2001 03:34 AM

one thing you can do is dont use this command so much:

setplayerprop#c, #v(this.foodenergy/100*100)%;
freezeplayer .6;

just put that after a weaponfired flag by itself

SSRobgeta 10-23-2001 03:38 AM

ok

btedji 10-23-2001 03:42 AM

and use strings if you want the data to save when player logs off

SSRobgeta 10-23-2001 03:44 AM

I dare you to fix script and post

btedji 10-23-2001 03:49 AM

i would if i was at home and on a better comp that had graal

SSRobgeta 10-23-2001 03:52 AM

when will you be home on a better computer with graal

btedji 10-23-2001 03:53 AM

about a hour

SSRobgeta 10-23-2001 03:54 AM

Can you do it then?

btedji 10-23-2001 03:57 AM

Quote:

Originally posted by SSRobgeta
Can you do it then?
if i am not busy

SSRobgeta 10-23-2001 03:59 AM

When you play Graal, you have nothing to do lol

SSRobgeta 10-23-2001 04:00 AM

When you play Graal, you have nothing to do lol:D

royce 10-23-2001 04:12 AM

copying off me ehh???

TDO2000 10-23-2001 05:55 AM

if (playertouchsme) {
toweapons Food Bar;
timeout=.05;
}
if (created && isweapon) {
set foodbargodown;
foodpower = this.foodenergy
timeout=.05;
}
if(weaponfired){
if(this.foodenergy=>80){
setani bloated,;
}
if(this.foodenergy<=79 && this.foodenergy >=60){
setani fine,;
}
if (this.foodenergy=<59 && this.foodenergy>=40) {
setani nothungry,;
}
if (this.foodenergy=< 39 && this.foodenergy>=20) {
setani hungry,;
}
setplayerprop#c, #v(this.foodenergy/100*100)%;
freezeplayer .6;
}

if(timeout){
if(this.foodenergy==100){
this.foodenergy++;
}
if (this.foodenergy=<0) {
disableweapons
}
else {
enableweapons
}
timeout=.1;
}

should work, not tested yet =)

SSRobgeta 10-23-2001 06:17 AM

Quote:

Originally posted by royce
copying off me ehh???
What?

SSRobgeta 10-23-2001 06:20 AM

Quote:

Originally posted by TDO2000
if (playertouchsme) {
toweapons Food Bar;
timeout=.05;
}
if (created && isweapon) {
set foodbargodown;
foodpower = this.foodenergy
timeout=.05;
}
if(weaponfired){
if(this.foodenergy=>80){
setani bloated,;
}
if(this.foodenergy<=79 && this.foodenergy >=60){
setani fine,;
}
if (this.foodenergy=<59 && this.foodenergy>=40) {
setani nothungry,;
}
if (this.foodenergy=< 39 && this.foodenergy>=20) {
setani hungry,;
}
setplayerprop#c, #v(this.foodenergy/100*100)%;
freezeplayer .6;
}

if(timeout){
if(this.foodenergy==100){
this.foodenergy++;
}
if (this.foodenergy=<0) {
disableweapons
}
else {
enableweapons
}
timeout=.1;
}

should work, not tested yet =)

Sorry but it doesn't =(

TDO2000 10-23-2001 06:27 AM

if (playertouchsme) {
toweapons Food Bar;
timeout=.05;
}
if (created && isweapon) {
set foodbargodown;
this.foodenergy=100;
timeout=.05;
}
if(weaponfired){
if(this.foodenergy=>80){
setani bloated,;
}
if(this.foodenergy<=79 && this.foodenergy >=60){
setani fine,;
}
if (this.foodenergy=<59 && this.foodenergy>=40) {
setani nothungry,;
}
if (this.foodenergy=< 39 && this.foodenergy>=20) {
setani hungry,;
}
setplayerprop#c, #v(this.foodenergy/100*100)%;
freezeplayer .6;
}

if(timeout){
if(this.foodenergy>0){
this.foodenergy--;
}
if (this.foodenergy=<0) {
disableweapons
}
else {
if(!weaponsenabled){
enableweapons
}
}
timeout=.5;
}

tested =)

SSRobgeta 10-23-2001 08:01 AM

Quote:

Originally posted by TDO2000
if (playertouchsme) {
toweapons Food Bar;
timeout=.05;
}
if (created && isweapon) {
set foodbargodown;
this.foodenergy=100;
timeout=.05;
}
if(weaponfired){
if(this.foodenergy=>80){
setani bloated,;
}
if(this.foodenergy<=79 && this.foodenergy >=60){
setani fine,;
}
if (this.foodenergy=<59 && this.foodenergy>=40) {
setani nothungry,;
}
if (this.foodenergy=< 39 && this.foodenergy>=20) {
setani hungry,;
}
setplayerprop#c, #v(this.foodenergy/100*100)%;
freezeplayer .6;
}

if(timeout){
if(this.foodenergy>0){
this.foodenergy--;
}
if (this.foodenergy=<0) {
disableweapons
}
else {
if(!weaponsenabled){
enableweapons
}
}
timeout=.5;
}

tested =)

Thanks!:D

btedji 10-23-2001 08:08 AM

sry i was busy lol

SSRobgeta 10-23-2001 06:23 PM

Np

SSRobgeta 10-23-2001 06:25 PM

Ok. Now I have the food bar done. How would I make food? would it do with this.foodenergy--; ?

TDO2000 10-23-2001 10:14 PM

omg
use a string where to save the hunger if u eat something add something to the string else let it go down...

dragoonvenganc 10-23-2001 10:15 PM

Rob i have over estimated u come on that was a dum question

SSRobgeta 10-24-2001 02:26 AM

LOL I was realy kidding. I wanted to see if someone would do it for me so I wouldn't have to.:rolleyes:


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

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