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, ;
// 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, ;