PDA

View Full Version : Contribution, a Safe!


SilentSkripter1988
08-18-2003, 12:31 AM
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
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
Originally posted by Python523


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

didnt know :(