Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   hat script (https://forums.graalonline.com/forums/showthread.php?t=10183)

9898 08-23-2001 02:49 AM

hat script
 
i found this script but its too long and would take days to put up all hats
// NPC made by Adrenaline
if (playerchats && strequals(#c,knighthelmet)) {
set knighthelmet;
unset samurai;
unset beret;
unset bomyshell;
unset gentleman;
unset fool;
unset pirate;
unset bandana;
unset cap;
unset turban;
unset elf;
unset blackbandana;
unset flower;
unset egg;
unset wingedknight;
unset crown;
unset shroom;
unset ladyhat;
unset cowboy;
unset elf2;
unset goldhelmet;
}
if (playerchats && strequals(#c,samurai)) {
unset knighthelmet;
set samurai;
unset beret;
unset bomyshell;
unset gentleman;
unset fool;
unset pirate;
unset bandana;
unset cap;
unset turban;
unset elf;
unset blackbandana;
unset flower;
unset egg;
unset wingedknight;
unset crown;
unset shroom;
unset ladyhat;
unset cowboy;
unset elf2;
unset goldhelmet;
}
if (playerchats && strequals(#c,beret)) {
unset knighthelmet;
unset samurai;
set beret;
unset bomyshell;
unset gentleman;
unset fool;
unset pirate;
unset bandana;
unset cap;
unset turban;
unset elf;
unset blackbandana;
unset flower;
unset egg;
unset wingedknight;
unset crown;
unset shroom;
unset ladyhat;
unset cowboy;
unset elf2;
unset goldhelmet;
}
if (playerchats && strequals(#c,bomyshell)) {
unset knighthelmet;
unset samurai;
unset beret;
set bomyshell;
unset gentleman;
unset fool;
unset pirate;
unset bandana;
unset cap;
unset turban;
unset elf;
unset blackbandana;
unset flower;
unset egg;
unset wingedknight;
unset crown;
unset shroom;
unset ladyhat;
unset cowboy;
unset elf2;
unset goldhelmet;
}
if (playerchats && strequals(#c,gentleman)) {
unset knighthelmet;
unset samurai;
unset beret;
unset bomyshell;
set gentleman;
unset fool;
unset pirate;
unset bandana;
unset cap;
unset turban;
unset elf;
unset blackbandana;
unset flower;
unset egg;
unset wingedknight;
unset crown;
unset shroom;
unset ladyhat;
unset cowboy;
unset elf2;
unset goldhelmet;
}
if (playerchats && strequals(#c,fool)) {
unset knighthelmet;
unset samurai;
unset beret;
unset bomyshell;
unset gentleman;
set fool;
unset pirate;
unset bandana;
unset cap;
unset turban;
unset elf;
unset blackbandana;
unset flower;
unset egg;
unset wingedknight;
unset crown;
unset shroom;
unset ladyhat;
unset cowboy;
unset elf2;
unset goldhelmet;
}
if (playerchats && strequals(#c,pirate)) {
unset knighthelmet;
unset samurai;
unset beret;
unset bomyshell;
unset gentleman;
unset fool;
set pirate;
unset bandana;
unset cap;
unset turban;
unset elf;
unset blackbandana;
unset flower;
unset egg;
unset wingedknight;
unset crown;
unset shroom;
unset ladyhat;
unset cowboy;
unset elf2;
unset goldhelmet;
}
if (playerchats && strequals(#c,bandana)) {
unset knighthelmet;
unset samurai;
unset beret;
unset bomyshell;
unset gentleman;
unset fool;
unset pirate;
set bandana;
unset cap;
unset turban;
unset elf;
unset blackbandana;
unset flower;
unset egg;
unset wingedknight;
unset crown;
unset shroom;
unset ladyhat;
unset cowboy;
unset elf2;
unset goldhelmet;
}
if (playerchats && strequals(#c,cap)) {
unset knighthelmet;
unset samurai;
unset beret;
unset bomyshell;
unset gentleman;
unset fool;
unset pirate;
unset bandana;
set cap;
unset turban;
unset elf;
unset blackbandana;
unset flower;
unset egg;
unset wingedknight;
unset crown;
unset shroom;
unset ladyhat;
unset cowboy;
unset elf2;
unset goldhelmet;
}
if (playerchats && strequals(#c,turban)) {
unset knighthelmet;
unset samurai;
unset beret;
unset bomyshell;
unset gentleman;
unset fool;
unset pirate;
unset bandana;
unset cap;
set turban;
unset elf;
unset blackbandana;
unset flower;
unset egg;
unset wingedknight;
unset crown;
unset shroom;
unset ladyhat;
unset cowboy;
unset elf2;
unset goldhelmet;
}
if (playerchats && strequals(#c,elf)) {
unset knighthelmet;
unset samurai;
unset beret;
unset bomyshell;
unset gentleman;
unset fool;
unset pirate;
unset bandana;
unset cap;
unset turban;
set elf;
unset blackbandana;
unset flower;
unset egg;
unset wingedknight;
unset crown;
unset shroom;
unset ladyhat;
unset cowboy;
unset elf2;
unset goldhelmet;
}
if (playerchats && strequals(#c,elf)) {
unset knighthelmet;
unset samurai;
unset beret;
unset bomyshell;
unset gentleman;
unset fool;
unset pirate;
unset bandana;
unset cap;
unset turban;
unset elf;
set blackbandana;
unset flower;
unset egg;
unset wingedknight;
unset crown;
unset shroom;
unset ladyhat;
unset cowboy;
unset elf2;
unset goldhelmet;
}
if (playerchats && strequals(#c,elf)) {
unset knighthelmet;
unset samurai;
unset beret;
unset bomyshell;
unset gentleman;
unset fool;
unset pirate;
unset bandana;
unset cap;
unset turban;
unset elf;
unset blackbandana;
set flower;
unset egg;
unset wingedknight;
unset crown;
unset shroom;
unset ladyhat;
unset cowboy;
unset elf2;
unset goldhelmet;
}
if (playerchats && strequals(#c,elf)) {
unset knighthelmet;
unset samurai;
unset beret;
unset bomyshell;
unset gentleman;
unset fool;
unset pirate;
unset bandana;
unset cap;
unset turban;
unset elf;
unset blackbandana;
unset flower;
set egg;
unset wingedknight;
unset crown;
unset shroom;
unset ladyhat;
unset cowboy;
unset elf2;
unset goldhelmet;
}
if (playerchats && strequals(#c,elf)) {
unset knighthelmet;
unset samurai;
unset beret;
unset bomyshell;
unset gentleman;
unset fool;
unset pirate;
unset bandana;
unset cap;
unset turban;
unset elf;
unset blackbandana;
unset flower;
unset egg;
set wingedknight;
unset crown;
unset shroom;
unset ladyhat;
unset cowboy;
unset elf2;
unset goldhelmet;
}
if (playerchats && strequals(#c,elf)) {
unset knighthelmet;
unset samurai;
unset beret;
unset bomyshell;
unset gentleman;
unset fool;
unset pirate;
unset bandana;
unset cap;
unset turban;
unset elf;
unset blackbandana;
unset flower;
unset egg;
unset wingedknight;
set crown;
unset shroom;
unset ladyhat;
unset cowboy;
unset elf2;
unset goldhelmet;
}
if (playerchats && strequals(#c,elf)) {
unset knighthelmet;
unset samurai;
unset beret;
unset bomyshell;
unset gentleman;
unset fool;
unset pirate;
unset bandana;
unset cap;
unset turban;
unset elf;
unset blackbandana;
unset flower;
unset egg;
unset wingedknight;
unset crown;
set shroom;
unset ladyhat;
unset cowboy;
unset elf2;
unset goldhelmet;
}
if (playerchats && strequals(#c,elf)) {
unset knighthelmet;
unset samurai;
unset beret;
unset bomyshell;
unset gentleman;
unset fool;
unset pirate;
unset bandana;
unset cap;
unset turban;
unset elf;
unset blackbandana;
unset flower;
unset egg;
unset wingedknight;
unset crown;
unset shroom;
set ladyhat;
unset cowboy;
unset elf2;
unset goldhelmet;
}
if (playerchats && strequals(#c,elf)) {
unset knighthelmet;
unset samurai;
unset beret;
unset bomyshell;
unset gentleman;
unset fool;
unset pirate;
unset bandana;
unset cap;
unset turban;
unset elf;
unset blackbandana;
unset flower;
unset egg;
unset wingedknight;
unset crown;
unset shroom;
unset ladyhat;
set cowboy;
unset elf2;
unset goldhelmet;
}
if (playerchats && strequals(#c,elf)) {
unset knighthelmet;
unset samurai;
unset beret;
unset bomyshell;
unset gentleman;
unset fool;
unset pirate;
unset bandana;
unset cap;
unset turban;
unset elf;
unset blackbandana;
unset flower;
unset egg;
unset wingedknight;
unset crown;
unset shroom;
unset ladyhat;
unset cowboy;
set elf2;
unset goldhelmet;
}
if (playerchats && strequals(#c,elf)) {
unset knighthelmet;
unset samurai;
unset beret;
unset bomyshell;
unset gentleman;
unset fool;
unset pirate;
unset bandana;
unset cap;
unset turban;
unset elf;
unset blackbandana;
unset flower;
unset egg;
unset wingedknight;
unset crown;
unset shroom;
unset ladyhat;
unset cowboy;
unset elf2;
set goldhelmet;
}
see what i mean
how can i shorten it

Komieko 08-23-2001 02:51 AM

Couldn't it be done WAY shorter with strings?I'm no scripting expert but couldn't it have been done shorter with the use of strings?

9898 08-23-2001 02:53 AM

i dont know much about scripting either so i need help

08-23-2001 03:13 AM

who the hell are those clowns

Lyndzey8000 08-23-2001 03:31 AM

That script would lag a lot. I recommend you using strings instead of flags, and you shouldnt use flags. If you dont get strings you should use this.variables which would cut down on the lag. I am not sure what the hat charprop is...if you find it for me I will script it. I am too busy to look for it.

ownerofbabylon 08-23-2001 04:12 AM

functions would come in handy too. Make a function that unsets all of the hats and then u could have it unset all hats and then add the 1 thats wanted. Thats much easier

Slaktmaster 08-23-2001 04:24 AM

LOL

Poogle 08-23-2001 04:32 AM

That guy who calles himself Satan told me the script and it was just 4 lines but i am not going to post it the level I put it in is to laggy cuse of to many hats I need to make another hat shop

LiquidIce00 08-23-2001 05:12 AM

do like
if (playerchats&&strequals(#c,elf hat)) {
setstring myhat,elf hat;
}

and hats work as Gani's.. its a param if u look at the command list on the bottom it even tells you

9898 08-23-2001 05:20 AM

I tried setplayerprop #p1, hat0.png; but it didnt work

9898 08-23-2001 05:24 AM

ok if (playerchats&&strequals(#c,elf hat)) {
setstring myhat,elf hat;
} didnt work i dont know why i think its cause the hat npc and hats have to run together so it didnt work :/ i may need both a new hat npc and script

nyghtGT 08-23-2001 08:00 AM

Hat Script ...
 
Here's my hat script ....
//NPC made by Nyght (FAQ)
if (playertouchsme) {
toweapons Samurai Farmer Hat;
hidelocal;
}
if (playerenters && !isweapon) {
if (hasweapon(Samurai Farmer Hat)) {
hidelocal;
} else {
showlocal;
}
}
if (weaponfired) {
if (this.on==false) {
this.on = true;
} else {
this.on = false;
}
timeout = 0.05;
}
if (timeout && this.on==true) {
if (this.puton==false) {
freezeplayer 0.1;
playersprite = 23;
showimg 1,samfarmhat1.gif,playerx,playery-0.7;
sleep 0.1;
playersprite = 24;
showimg 1,samfarmhat1.gif,playerx,playery-1.1;
this.puton = true;
}
if (playerdir==0) {
if (strequals(#m,sword)) {
showimg 1,samfarmhat1.gif,playerx,playery-1.3;
}
else if (strequals(#m,grab)) {
showimg 1,samfarmhat1.gif,playerx,playery-0.9;
}
else if (strequals(#m,pull)) {
showimg 1,samfarmhat2.gif,playerx+0.3,playery+1;
}
else if (strequals(#m,hurt)) {
showimg 1,samfarmhat1.gif,playerx,playery-0.8;
}
else if (strequals(#m,sit)) {
showimg 1,samfarmhat1.gif,playerx,playery-1.3;
} else {
showimg 1,samfarm1.gif,playerx,playery-1;
}
}
if (playerdir==1) {
if (strequals(#m,sword)) {
showimg 1,samfarmhat1.gif,playerx-0.1,playery-1;
}
else if (strequals(#m,grab)) {
showimg 1,samfarmhat1.gif,playerx-0.1,playery-1;
}
else if (strequals(#m,pull)) {
showimg 1,samfarmhat3.gif,playerx+2,playery;
}
else if (strequals(#m,hurt)) {
showimg 1,samfarmhat1.gif,playerx+0.1,playery-0;
}
else if (strequals(#m,sit)) {
showimg 1,samfarmhat1.gif,playerx+0.5,playery-1;
}
else if (strequals(#m,push)) {
showimg 1,samfarmhat1.gif,playerx,playery-1.1;
} else {
showimg 1,samfarmhat1.gif,playerx+0.15,playery-2;
}
}
if (playerdir==2) {
if (strequals(#m,sword)) {
showimg 1,samfarmhat1.gif,playerx,playery-0.9;
}
else if (strequals(#m,grab)) {
showimg 1,samfarmhat1.gif,playerx,playery-0.7;
}
else if (strequals(#m,pull)) {
showimg 1,samfarmhat5.gif,playerx+0.3,playery;
}
else if (strequals(#m,hurt)) {
showimg 1,samfarmhat1.gif,playerx,playery-1;
}
else if (strequals(#m,sit)) {
showimg 1,samfarmhat1.gif,playerx,playery-1.5;
}
else if (strequals(#m,push)) {
showimg 1,samfarmhat1.gif,playerx,playery-0.7;
} else {
showimg 1,samfarmhat1.gif,playerx,playery-1;
}
}
if (playerdir==3) {
if (strequals(#m,sword)) {
showimg 1,samfarmhat1.gif,playerx,playery-1;
}
else if (strequals(#m,grab)) {
showimg 1,samfarmhat1.gif,playerx-0.1,playery-1.5;
}
else if (strequals(#m,pull)) {
showimg 1,samfarmhat4.gif,playerx-0.5,playery;
}
else if (strequals(#m,hurt)) {
showimg 1,samfarmhat1.gif,playerx+0.1,playery-1.5;
}
else if (strequals(#m,sit)) {
showimg 1,samfarmhat1.gif,playerx-0.3,playery-1.5;
}
else if (strequals(#m,push)) {
showimg 1,samfarmhat1.gif,playerx+0.1,playery-1.5;
} else {
showimg 1,samfarmhat1.gif,playerx-0.1,playery-1
}
}
if (strequals(#m,dead) || strequals(#m,swim)) {
this.on = false;
this.skip = true;
}
timeout = 0.05;
}
if (timeout && this.on==false) {
if (this.skip==true) {
freezeplayer 0.5;
playersprite = 24;
showimg 1,samfarmhat1.gif,playerx,playery-1.1;
sleep 0.1;
playersprite = 23;
showimg 1,samfarmhat1.gif,playerx,playery-0.7;
sleep 0.1;
}
} else {
showimg 1,samfarmhat1.gif,playerx-0.1,playery-1;
}
}
if (strequals(#m,dead) || strequals(#m,swim)) {
this.on = false;
this.skip = true;
}
timeout = 0.05;
}
if (timeout && this.on==false) {
if (this.skip==true) {
freezeplayer 0.5;
playersprite = 24;
showimg 1,samfarmhat1.gif,playerx,playery-1.1;
sleep 0.1;
playersprite = 23;
showimg 1,samfarmhat1.gif,playerx,playery-0.7;
sleep 0.1;
}
hideimg 1;
sleep 0.1;
playersprite = 0;
this.puton = false;
this.skip = false;
}
It sorta works ...
http://www.deceptiononline.f2s.com/nyghtdoll.gif

omni-m00gle 08-23-2001 10:31 AM

if (playerchats && weaponfired && strcontains(hat)) {
setplayerprop #P1,#C;
}
Im not sure if that would work, because I made it off the top of my simple minded head.

CrazedMerlin 08-23-2001 11:10 AM

if (playerchats) {tokenize #c;
if (playerchats&&strequals(#c, )) {
setcharprop #whateverhatisiforgot,#t(#c));
}
}

or something

08-23-2001 11:36 AM

nyght your a idiot! thats my script i made, and is showed you it! please dont be a idiot and steal my scripts you idiot!

toad1413 08-23-2001 06:06 PM

I have a good, working, non-laggy hat script that I made just using this.vars. I'm sure it could be fixed up and made better, but it's still good. If enough people want me to post it here, I might. And I don't mean just people like IcePick who'll steal it then call it their own. It's even commented fully. :)

Vinvect 08-23-2001 09:22 PM

pleez?
 
may i please see it? ill give credit to u if i put it in my p2p server.(i dont know if its gonna be p2p with bomys or non-p2p without bomys)
cuz im still workin on it.)so pleez? can u pm it to me? pleez?:confused: :( :o :confused: :( :o

nyghtGT 08-24-2001 09:18 AM

OMG !!!
 
I GOT HE CAPS ON ICE AND YOUR GONNA GET IT NOW !!!!
FIRST OF ALL YOU NEVER SHOWED ME ANYTHING ... YOU NEVER TALK(ED) TO ME ... ALL YOU CARED THAT I MADE WAS THOSE STAFF STUFF FOR DELTERIA AND DONT TRY TO ACT LIKE YOU MADE EM AND I DIDN'T EVEN MAK EM .... JEDIMASTER GAVE EM TO ME ... AND I MEANT TO SAY THATTI IS WHAT I THINK HTS WILL WORK FOR .... SO DONT GIVE ME S*IT ABOUT STEALING CAUE I DONT STEAL ... I WILL TRY TO SCRIPT IT THEN IF I CANT I ASK FOR HELP ... UNLIKE YOU ....!!!!!!!!!!!!!
SO F*CK OFF !!!!!!!!!!!
http://www.deceptiononline.f2s.com/nyghtdoll.gif

konidias 08-25-2001 01:57 AM

Could someone tell me the point of all that scripting?

here you go:

NPC Code:

if (playerchats && strequals(#c,knighthelmet)) {
set haton;
setplayerprop #P1,hat0.png;
}



oh and for the hat item:

NPC Code:

if (playerenters) {
toweapons Hat;
setimg haticon.png;
}
if (weaponfired&&!haton&&knighthelmet) {
set haton;
setplayerprop #P1,hat0.png;
setani haton,;
freezeplayer 0.6;
sleep 0.6;
}
// taking hat off
if(weaponfired&&haton){
unset haton;
setani hatoff,;
freezeplayer 0.6;
sleep 0.6;
setplayerprop #P1,;
}


grim_squeaker_x 08-25-2001 03:09 AM

Quote:

Originally posted by konidias
Could someone tell me the point of all that scripting?

here you go:

NPC Code:

if (playerchats && strequals(#c,knighthelmet)) {
set haton;
setplayerprop #P1,hat0.png;
}



oh and for the hat item:

NPC Code:

if (playerenters) {
toweapons Hat;
setimg haticon.png;
}
if (weaponfired&&!haton&&knighthelmet) {
set haton;
setplayerprop #P1,hat0.png;
setani haton,;
freezeplayer 0.6;
sleep 0.6;
}
// taking hat off
if(weaponfired&&haton){
unset haton;
setani hatoff,;
freezeplayer 0.6;
sleep 0.6;
setplayerprop #P1,;
}


NPC Code:
if (weaponfired) {
if (strlen(#P1)>0) {
setplayerprop #P1,#s(client.hat);
setani haton,;
freezeplayer 0.6;
sleep 0.6;
}
else {
setani hatoff,;
freezeplayer 0.6;
sleep 0.6;
setplayerprop #P1,;
}
}


konidias 08-25-2001 07:34 PM

I just happened to have the code.. I didn't make it.. nor did I edit it.. :rolleyes:


All times are GMT +2. The time now is 07:59 PM.

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