Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Help With Rupee Dropper (https://forums.graalonline.com/forums/showthread.php?t=14025)

Vinvect 10-07-2001 08:46 AM

Help With Rupee Dropper
 
how can drop rupees just leik the one in N-Pulse?
plz tell me!
tha one leik if u say 1000 then it lays a gold rupee 1 at a time,
and stuff. how can i do that? and it takes away money too. OH PLEEZ, TELL ME!!

Knightoffrost 10-07-2001 09:59 AM

[ Delph Inc. ]

I don't really get what you mean by saying 'one by one' because I haven't seen it on N-Pulse...but I'll try help you:

if (playerchats) tokenize #c;
if (strequals(#t(0),setrupee)) setstring rupeedrop,#t(1);
timeout=0.2;
if (timeout) {
for (i=0;i<#s(rupeedrop)/100;i++) {
lay goldrupee;
}
timeout=0.2;
}

That should work...just say: setrupee <amount> and it should lay a gold rupee until it adds to the number...you would be able to change this so it fits red, blue and green rupees too.

Vinvect 10-08-2001 02:45 AM

what i eman is it lays one rupee then it slppp,1 02 sleep.2 then it lays another one then again it sleeps then lays another one. thanks anyway!:D

entravial 10-08-2001 10:02 AM

~AlphaFlame~

?

if (playerchats && startswith(layrupees,#c)){
tokenize #c;
this.lay=#t(1);
timeout=1;
}
if (timeout && playerrupees>this.lay-1){
if (this.lay>100){
lay goldrupee;
this.lay-=100;
playerrupees-=100;
break;
}
if (this.lay>30){
lay redrupee;
this.lay-=30;
playerrupees-=30;
break;
}
if (this.lay>5){
lay bluerupee;
this.lay-=5;
playerrupees-=5;
break;
}
if (this.lay>1){
lay greenrupee;
this.lay-=1;
playerrupees-=1;
break;
}
if (this.lay>0)timeout=1;
}

Now watch Kaimetsu come along and raise hell about "inefficientcy" XD

Knightoffrost 10-08-2001 02:27 PM

Quote:

Originally posted by Vinvect
what i eman is it lays one rupee then it slppp,1 02 sleep.2 then it lays another one then again it sleeps then lays another one. thanks anyway!:D
[ Delph Inc. ]

NPC Code:

if (created) {
i = 0;
timeout=0.2;
}
if (playerchats) tokenize #c;
if (strequals(#t(0),setrupee)) setstring rupeedrop,#t(1);
if (timeout) {
if (i<#s(rupeedrop)/100) {
lay goldrupee;
i++;
}
timeout=0.2;
}



You could also make it lay green, blue or red rupees as well as gold for more efficiency, if a player such as says something like 'setrupee 136'


All times are GMT +2. The time now is 10:43 AM.

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