Quote:
Originally posted by SSmutz
About a week after I quit FAQ, my computer got fried and I'm getting it back tomorrow, completely fixed.
|
yey come visit =)
oh yeah and I forgot the sleep bar but I took it off.
and im giving away the code if any1 wants.
you need sleep or the bar goes down. if the bar goes empty you start to get hurt.
it goes up when your in bed.
// NPC made by LiquidIce
//sleepy system
//Do Not Use w/o Author Permission!!!!
// made for Unholy Nation
if (playerenters&&!isweapon&&!hasweapon(-sleepsystem)) {
hide;
toweapons -sleepsystem;
setstring sleepcounter,70;
timeout=.05;
}
if (playerenters&&!isweapon&&hasweapon(sleepsystem)) { hide; }
if (playerenters&&isweapon) {
if (timeout=0) { timeout=.05; }
}
if (timeout) {
checksleep();
checkhurt();
Draw();
timeout=.05;
}
function checksleep() {
this.sleepneed=strtofloat(#s(sleepcounter));
if (strequals(#m,sleep)&&this.sleepneed<70) {
this.sleepneed+=.05;
}
if (this.sleepneed>1&&!strequals(#m,sleep)&&!strequal s(#m,dead)) { this.sleepneed-=.001; }
//checks
// if (strequals(#m,dead)||this.sleepneed>70) { this.sleepneed=70; }
if (this.sleepneed<1) { this.sleepneed=1; }
//set string
setstring sleepcounter,#v(this.sleepneed);
}
function Draw() {
//design
showimg 251,unsleepbar.gif,17,125;
changeimgpart 251,,,124,24;
changeimgvis 251,4;
//bar
showimg 250,unsleepbar.gif,66,127;
changeimgpart 250,,24,strtofloat(#s(sleepcounter)),19;
changeimgvis 250,4;
}
function checkhurt() {
this.hurtplayer+=1;
if (this.hurtplayer=100) { this.hurtplayer=0; }
if (!strequals(#m,sleep)&&!strequals(#m,dead)&&strtof loat(#s(sleepcounter))=1&&this.hurtplayer=99) {
hurt 1;
}
}
if (playerdies) {
this.checklife=strtofloat(#s(sleepcounter));
if (this.checklife<25) { this.checklife=25; }
setstring sleepcounter,#v(this.checklife);
}