![]() |
Beer Script (help w/ strings)
Ok. I am working on a beer script but I need some help. Anyways, here is what i have so far...
//Beer made by Raine if (hasbeer) {replaceani idle,rainebeer; replaceani walk, rainebeerwalk;replaceani sit,rainesitbeer} while (six=S && hasbeer){disableweapons; if (keydown(6)) {setani rainedrinkbeer,;sleep 1;set drank} if (drank) { i = random(0,4); if (i in <0,2>) setani rainedrankbeer,; else if (i in <2,3>) setani rainedrunkbarf,; else if (i in <3,4>) setani rainedrankitok, ;} sleep .05;unset drank;} Anyways, i need help. I want it so after you drink 5 times you lose the beer (change ganis back to reg. walk,idle,sit;unset the hasbeer) and also if you passout (rainedrunkbarf ganis) you stay on the ground for 6 seconds and lose the beer even if you havent drank 5. Anyways, any help is megapreciated. Peace. |
Re: Beer Script (help w/ strings)
Quote:
//Beer made by GÄ$†£Ÿ if (hasbeer) {replaceani idle,rainebeer; replaceani walk, rainebeerwalk;replaceani sit,rainesitbeer} while (six=S && hasbeer){disableweapons; if (keydown(6)&&this.drink<=5) { this.drink+=1; setani rainedrinkbeer,;sleep 1;set drank} if (drank) { i = random(0,4); if (i in <0,2>) setani rainedrankbeer,; else if (i in <2,3>) setani rainedrunkbarf,; else if (i in <3,4>) setani rainedrankitok, ;} sleep .05;unset drank;} if (this.drink==5) { replaceani sit,sit; replaceani walk,walk; replaceani idle,idle; destroy; } |
1 Attachment(s)
:( it didnt work. I think it may be another npc in my level or something. Here's my bar with all the pics if anyone wants to take a crack.
|
~AlphaFlame~
1- Learn to script better 2- Don't use flags for that kind of stuff. |
What do you suggest i use then? :confused:
|
~AlphaFlame~
You could take some time to learn this. variables... while (six=S) .... err... I'll trust that that's some kind of hidden built-in variable that is has text as the assigned value... |
Yeah i was thinking that I should need variables for this. Is there any place that has some tutorial or quick view to variables because I have no idea how they work, i still dont know how strings work very well x.X
|
~AlphaFlame~
Try Ace's newbie scripting bible. It's in the www.graal2001.com library section, under NPC Scripting. |
//Beer made by Raine
//with Help from Gastey and Sage. if (hasbeer) { replaceani idle,rainebeer; replaceani walk, rainebeerwalk; replaceani sit,rainesitbeer;} if (playertouchsme) { set hasbeer;} while (zero==0 && hasbeer){ disableweapons; if (keydown(6)&&this.drink<5) { this.drink+=1; setani rainedrinkbeer,; sleep 1; set drank;} if (drank) { i = random(0,4); if (i in <0,2> ) setani rainedrankbeer,; else if (i in <2,3> ) setani rainedrunkbarf,; else if (i in <3,4> ) setani rainedrankitok, ;} unset drank; if (this.drink==5) { unset hasbeer; replaceani sit,sit; replaceani walk,walk; replaceani idle,idle; sleep .05; this.drink==0;enableweapons} sleep .05;} There we go. Perfect :p. Ok, new goal. How can I make it so if your gani is rainedrunkbarf (the passout ganis) you stay on the floor for 6 seconds and then lose the beer? I know it has something to do with making this.drink==5 but I dont know how for it to detect the ganis is rainedrunkbarf for it to work. |
if (hasbeer) {
replaceani idle,rainebeer; replaceani walk, rainebeerwalk; replaceani sit,rainesitbeer;} if (playertouchsme) { set hasbeer;} while (zero==0 && hasbeer){ disableweapons; if (keydown(6)&&this.drink<5) { this.drink+=1; setani rainedrinkbeer,; sleep 1; set drank;} if (drank) { i = random(0,4); if (i in <0,2> ) setani rainedrankbeer,; else if (i in <2,3> ) {setani rainedrunkbarf,; freezeplayer 6; this.drink==5} else if (i in <3,4> ) setani rainedrankitok, ;} unset drank; if (this.drink==5) { unset hasbeer; replaceani sit,sit; replaceani walk,walk; replaceani idle,idle; sleep .05; this.drink==0;enableweapons} sleep .05;} Try that, it might not work but try |
Nope. I also tried:
if (hasbeer) { replaceani idle,rainebeer; replaceani walk, rainebeerwalk; replaceani sit,rainesitbeer;} if (playertouchsme) { set hasbeer;} while (zero==0 && hasbeer){ disableweapons; if (keydown(6)&&this.drink<5) { this.drink+=1; setani rainedrinkbeer,; sleep 1; set drank;} if (drank) { i = random(0,4); if (i in <0,2> ) setani rainedrankbeer,; else if (i in <3,4> ) setani rainedrankitok, ; else if (i in <2,3> ) {setani rainedrunkbarf,; disabledefmovement;sleep 5;this.drink==5;enabledefmovement;replaceani sit,sit; replaceani walk,walk; replaceani idle,idle}; } unset drank; if (this.drink==5) { unset hasbeer; replaceani sit,sit; replaceani walk,walk; replaceani idle,idle; sleep .05; this.drink==0;enableweapons} sleep .05;} but it would make it so i couldnt move (but could drink) for 5 seconds after no matter what result came out and id lose the beer. |
change "i in <3,4>" to "i in |3,4|"
|
~AlphaFlame~
You're still setting flags... ok, I'll emphasize this. YOU DO NOT NEED ANY FLAGS FOR THIS SCRIPT |
Ok I took out the flags, lol.
Also the |3,4| thing works but it will bug up and do like .5 of the passout thing but change to the rainedrankok gani but it will still freeze you for 6 seconds. |
Freezeplayer?
|
All times are GMT +2. The time now is 02:07 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.