Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Contribution, a Safe! (https://forums.graalonline.com/forums/showthread.php?t=47248)

SilentSkripter1988 08-18-2003 12:31 AM

Contribution, a Safe!
 
Heres a safe script I made, if anyone wants to use it or correct any errors in it, go ahead.

// NPC made by Silent Skripter *Scripting*
if (created) {
}
if (playertouchsme) {
}
if (playerchats && strcontains(#c,/pay)){
tokenize #c;
this.rupeeadd = strtofloat(#t(1));
if (playerrupees >= this.rupeeadd){
if (this.rupeeadd > 0){
playerrupees -= this.rupeeadd;
this.safemoney += this.rupeeadd;
setcharprop #c,#v(this.safemoney) dollars in safe!;
timeout=5;
}
}
}

if (playerchats && strcontains(#c,/take)){
tokenize #c;
this.takemoney = strtofloat(#t(1));
if (this.safemoney >= this.takemoney){
if (this.takemoney > 0){
if (strequals(#a,Your Account Here!)){
playerrupees += this.takemoney;
this.safemoney -= this.takemoney;
setplayerprop #c, Took #v(this.takemoney) dollars out of safe!;
setcharprop #c, #v(this.safemoney) left in safe!
timeout = 5;
}
}
}
}

if (timeout){
setcharprop #c, ;

Python523 08-18-2003 12:34 AM

use [code] tags

mhermher 08-18-2003 12:44 AM

/pay -50

SilentSkripter1988 08-18-2003 12:46 AM

Read the script, /pay -50 wont work. It makes sure the number is at least 1.

wonderboysp2p 08-18-2003 06:05 AM

/pay 2.5

SilentSkripter1988 08-18-2003 05:52 PM

Fixed.

Alexander 08-18-2003 07:59 PM

You have some errors in your script.

setcharprop #c, #v(this.safemoney) left in safe!;

if (timeout){
setcharprop #c, ;
}
Also learn how to style, or use the style button in editor :o

Python523 08-18-2003 08:33 PM

Quote:

Originally posted by Alexander
You have some errors in your script.

setcharprop #c, #v(this.safemoney) left in safe!;

if (timeout){
setcharprop #c, ;
}
Also learn how to style, or use the style button in editor :o

the forums breaks people's styling unless you use [code] tags :o

Alexander 08-18-2003 08:42 PM

Quote:

Originally posted by Python523


the forums breaks people's styling unless you use [code] tags :o

didnt know :(


All times are GMT +2. The time now is 01:33 PM.

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