![]() |
Bar Store Script
Hi I'm making a bar for my server. I made it so far except the part when the money goes in the chest. I'd greatly appreciate it if someone help me. Heres the system script of the bar:
// NPC made by heX (Owner) if (playerenters) { } if (playertouchsme) { say 0; } if (strequals(#g, Owner)&&(strequals(#c, Sell 1))) { putnpc beer.gif,beer.txt,30,17; } if (strequals(#g, Owner)&&(strequals(#c, Sell 2))) { putnpc beer.gif,beer.txt,30,21; } if (strequals(#g, Owner)&&(strequals(#c, Sell 3))) { putnpc beer.gif,beer.txt,33,24; } if (strequals(#g, Owner)&&(strequals(#c, Sell 4))) { putnpc beer.gif,beer.txt,41,24; } if (strequals(#g, Owner)&&(strequals(#c, Sell 5))) { putnpc beer.gif,beer.txt,46,21; } if (strequals(#g, Owner)&&(strequals(#c, Sell 6))) { putnpc beer.gif,beer.txt,46,17; } if (strequals(#g, GTManager)&&(strequals(#c, Sell 1))) { putnpc beer.gif,beer.txt,30,17; } if (strequals(#g, GTManager)&&(strequals(#c, Sell 2))) { putnpc beer.gif,beer.txt,30,21; } if (strequals(#g, GTManager)&&(strequals(#c, Sell 3))) { putnpc beer.gif,beer.txt,33,24; } if (strequals(#g, GTManager)&&(strequals(#c, Sell 4))) { putnpc beer.gif,beer.txt,41,24; } if (strequals(#g, GTManager)&&(strequals(#c, Sell 5))) { putnpc beer.gif,beer.txt,46,21; } if (strequals(#g, GTManager)&&(strequals(#c, Sell 6))) { putnpc beer.gif,beer.txt,46,17; } if (strequals(#g, GTStaff)&&(strequals(#c, Sell 1))) { putnpc beer.gif,beer.txt,30,17; } if (strequals(#g, GTStaff)&&(strequals(#c, Sell 2))) { putnpc beer.gif,beer.txt,30,21; } if (strequals(#g, GTStaff)&&(strequals(#c, Sell 3))) { putnpc beer.gif,beer.txt,33,24; } if (strequals(#g, GTStaff)&&(strequals(#c, Sell 4))) { putnpc beer.gif,beer.txt,41,24; } if (strequals(#g, GTStaff)&&(strequals(#c, Sell 5))) { putnpc beer.gif,beer.txt,46,21; } if (strequals(#g, GTStaff)&&(strequals(#c, Sell 6))) { putnpc beer.gif,beer.txt,46,17; } if (strequals(#g, Owner)&&(strequals(#c, Free Sell))) { putnpc beer.gif,beerfree.txt,30,17; putnpc beer.gif,beerfree.txt,30,21; putnpc beer.gif,beerfree.txt,33,24; putnpc beer.gif,beerfree.txt,41,24; putnpc beer.gif,beerfree.txt,46,21; putnpc beer.gif,beerfree.txt,46,17; } if (strequals(#g, Owner)&&(strequals(#c, Sell All))) { putnpc beer.gif,beer.txt,30,17; putnpc beer.gif,beer.txt,30,21; putnpc beer.gif,beer.txt,33,24; putnpc beer.gif,beer.txt,41,24; putnpc beer.gif,beer.txt,46,21; putnpc beer.gif,beer.txt,46,17; } if (strequals(#g, GTManager)&&(strequals(#c, Sell All))) { putnpc beer.gif,beer.txt,30,17; putnpc beer.gif,beer.txt,30,21; putnpc beer.gif,beer.txt,33,24; putnpc beer.gif,beer.txt,41,24; putnpc beer.gif,beer.txt,46,21; putnpc beer.gif,beer.txt,46,17; } if (strequals(#g, GTStaff)&&(strequals(#c, Sell All))) { putnpc beer.gif,beer.txt,30,17; putnpc beer.gif,beer.txt,30,21; putnpc beer.gif,beer.txt,33,24; putnpc beer.gif,beer.txt,41,24; putnpc beer.gif,beer.txt,46,21; putnpc beer.gif,beer.txt,46,17; } [B] if (itemlayed) { take greenrupee;take redrupee;take bluerupee;take goldrupee; } if(strequals(#g,Owner)&&strequals(#c,Take Donation)){playerrupees=playerrupees+rupees; rupees=0;} if(strequals(#g,Owner)&&strequals(#c,See Donations)){message #v(rupees) Gralat; sleep2; message ;} Im having a problem with the item layed part: if (itemlayed) { take greenrupee;take redrupee;take bluerupee;take goldrupee; } Here is the beer script (beer.txt): if (playertouchsme&&(playerrupees>4)) {playerrupees-=5; show; setplayerprop #c, Ah! Fells good!; lay2 bluerupee,0,0; sleep .5; putleaps 5,x+0.5,y+0; hide; playerhearts+=3; } Please someone I really need your help! :confused: Email it to me if you wish at [email protected] |
the event is "playerlaysitem" not "itemlayed"
|
also, the putnpc has no "destroy" command (BAD! BAD! BAD!)
|
just do like on the chest
if (actionadd) { rupees+=strtofloat(#p(0)); } then on the beer.txt thing you want to put if (playertouchsme ) { ... whatever here like heal the palyer blabla.. triggeraction xOfTheChest,yOfTheChest,add,CostOfBeer; } |
hmm...wait, you might want to do it another way (since it's not the player that lays the item
if (playerenters) timeout=.05; if (timeout) { take greenrupee; take bluerupee; take redrupee; take goldrupee; timeout=.05; } |
that script is annoyingly long ....
use tokenizing or something ... |
Try this
Try doing this... Put a beer GFX at each spot where you want the beer to Appear. Add in there..
If (playerenters) hide; if (strequals(#g, Owner)&&(strequals(#c, Sell 1))) { show; if (playertouchsme) playerhearts+= 3; hide; And you can put these npcs in all the spots. |
? HELp!
I used liquids way cuz he knowz alot of thingz =)
but it didnt quite work maby i did something wrong heres the system script: // NPC made by heX if (playerenters) { x = 38; y = 14; } if (playertouchsme) { say 0; } if (strequals(#g, Owner)&&(strequals(#c, Sell 1))) { putnpc beer.gif,beer.txt,30,17; } if (strequals(#g, Owner)&&(strequals(#c, Sell 2))) { putnpc beer.gif,beer.txt,30,21; } if (strequals(#g, Owner)&&(strequals(#c, Sell 3))) { putnpc beer.gif,beer.txt,33,24; } if (strequals(#g, Owner)&&(strequals(#c, Sell 4))) { putnpc beer.gif,beer.txt,41,24; } if (strequals(#g, Owner)&&(strequals(#c, Sell 5))) { putnpc beer.gif,beer.txt,46,21; } if (strequals(#g, Owner)&&(strequals(#c, Sell 6))) { putnpc beer.gif,beer.txt,46,17; } if (strequals(#g, GTManager)&&(strequals(#c, Sell 1))) { putnpc beer.gif,beer.txt,30,17; } if (strequals(#g, GTManager)&&(strequals(#c, Sell 2))) { putnpc beer.gif,beer.txt,30,21; } if (strequals(#g, GTManager)&&(strequals(#c, Sell 3))) { putnpc beer.gif,beer.txt,33,24; } if (strequals(#g, GTManager)&&(strequals(#c, Sell 4))) { putnpc beer.gif,beer.txt,41,24; } if (strequals(#g, GTManager)&&(strequals(#c, Sell 5))) { putnpc beer.gif,beer.txt,46,21; } if (strequals(#g, GTManager)&&(strequals(#c, Sell 6))) { putnpc beer.gif,beer.txt,46,17; } if (strequals(#g, GTStaff)&&(strequals(#c, Sell 1))) { putnpc beer.gif,beer.txt,30,17; } if (strequals(#g, GTStaff)&&(strequals(#c, Sell 2))) { putnpc beer.gif,beer.txt,30,21; } if (strequals(#g, GTStaff)&&(strequals(#c, Sell 3))) { putnpc beer.gif,beer.txt,33,24; } if (strequals(#g, GTStaff)&&(strequals(#c, Sell 4))) { putnpc beer.gif,beer.txt,41,24; } if (strequals(#g, GTStaff)&&(strequals(#c, Sell 5))) { putnpc beer.gif,beer.txt,46,21; } if (strequals(#g, GTStaff)&&(strequals(#c, Sell 6))) { putnpc beer.gif,beer.txt,46,17; } if (strequals(#g, Owner)&&(strequals(#c, Free Sell))) { putnpc beer.gif,beerfree.txt,30,17; putnpc beer.gif,beerfree.txt,30,21; putnpc beer.gif,beerfree.txt,33,24; putnpc beer.gif,beerfree.txt,41,24; putnpc beer.gif,beerfree.txt,46,21; putnpc beer.gif,beerfree.txt,46,17; } if (strequals(#g, Owner)&&(strequals(#c, Sell All))) { putnpc beer.gif,beer.txt,30,17; putnpc beer.gif,beer.txt,30,21; putnpc beer.gif,beer.txt,33,24; putnpc beer.gif,beer.txt,41,24; putnpc beer.gif,beer.txt,46,21; putnpc beer.gif,beer.txt,46,17; } if (strequals(#g, GTManager)&&(strequals(#c, Sell All))) { putnpc beer.gif,beer.txt,30,17; putnpc beer.gif,beer.txt,30,21; putnpc beer.gif,beer.txt,33,24; putnpc beer.gif,beer.txt,41,24; putnpc beer.gif,beer.txt,46,21; putnpc beer.gif,beer.txt,46,17; } if (strequals(#g, GTStaff)&&(strequals(#c, Sell All))) { putnpc beer.gif,beer.txt,30,17; putnpc beer.gif,beer.txt,30,21; putnpc beer.gif,beer.txt,33,24; putnpc beer.gif,beer.txt,41,24; putnpc beer.gif,beer.txt,46,21; putnpc beer.gif,beer.txt,46,17; } if (actionadd) { rupees+=strtofloat(#p(0)); } if(strequals(#g,Owner)&&strequals(#c,Take Donation)){playerrupees=playerrupees+rupees; rupees=0;} if(strequals(#g,Owner)&&strequals(#c,See Donations)){message #v(rupees) Gralat; sleep2; message ;} heres the beer script : if (playertouchsme&&(playerrupees>4)) {playerrupees-=5; show; setplayerprop #c, Ah! Fells good!; sleep .5; putleaps 5,x+0.5,y+0; hide; playerhearts+=3; triggeraction 38,14,add,5; } |
the triggeraction x,y should be of the cash register chest.. and it should work
try doing this rupees+=strtofloat(#s(#p(0))); that might work |
Re: ? HELp!
Quote:
|
im confused now...
I am extramly confused will someone help me out by liquids way?
|
~AlphaFlame~
I can't lower myself to Liquid's level, but here's some help... I'm not 100% sure it'll work since I'm not using the graal editor to check everything, but it should. //The Main NPC 1- set an array of the x's you want 2- set an array of the y's you want 3- check the position based on the number said 4- put an npc there 5- add donation acceptances 6- add money withdrawal //The Beer.txt NPC 1- check if the player touchs 2- Take some money from the player 3- Add it to a string Finished script: //The Main NPC if (playerenters){ this.x={30,30,33,41,46,46}; this.y={17,21,24,24,21,17}; } if (playerchats){ if (strequals(#g,Owner) || strequals(#g,GTManager) || strequals(#g,GTStaff)){ if (strequals(#g,Owner)){ if (strequals(#c,take donations)){ playerrupees+=strtofloat(#s(server.barrupees)); setstring server.barrupees,; } if (strequals(#c,see donations)){ message strtofloat(#s(server.barrupees)) rupees; } } tokenize #c; if (strequals(#t(0),Sell)){ this.put=strtofloat(#t(1))-1; putnpc beer.gif,,this.x[this.put],this.y[this.put] } if (strequals(#t(0),Free)){ for (this.put=-1;this.put<arraylen(this.x);this.put++){ putnpc beer.gif,,this.x[this.put],this.y[this.put]; } } } } if (playerchats && startswith(donate,#c)){ tokenize #c; if (playerrupees>=strtofloat(#t(1))){ setstring server.barrupees,#v(strtofloat(#s(server.barrupees ))+strtofloat(#t(1))); } } //The Beer.txt if (playertouchsme && playerrupees>=5){ playerhearts+=2; playerrupees-=5; setplayerprop #c,Ahhh... feels good!; setstring server.barrupees,#v(strtofloat(#s(server.barrupees ))+5); sleep .5; putleaps 5,x+0.5,y+0; destroy; } |
thxs
thxs man
|
doesnt work
doesnt work
|
~AlphaFlame~
Like I said, I didn't use Graal Editor for that script... so what's wrong with it? I think my computer can actually open a graal window now without crashing and burning >.<; *checks* Yup. |
liquid ain't that good, he's like average...
|
| All times are GMT +2. The time now is 01:35 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.