Okay so I got a request to make a simple money system, and when I made it, I realized it was pretty cool and I decided to add some features, and It turned into a pretty well working Money System. It's also a great start for those making an RPG game! I usually don't like sharing my scripts, but after getting request after request, I decided to post it on Hawkee. Enjoy!
Commands:
&give: Only one person can use this command, this generates any amount of money, and gives it to any person. (Syntax: &give (user) (amount))
&take: Only one person can use this command; this takes away money from either a users carrying money, or his/her personal safe (if the user has one). (Syntax: &take (stash OR carry) (user) (amount))
!give: Can be used by all users; it transfers money from your account to another players. (Syntax: !give money (user) (amount))
!mug: Attempt to mug a user for between 1 to 50 dollars. Sometimes you will succeed, other times you will be caught and be charged a 500 dollar fine. (Syntax: !mug (user))
!properties: View all available properties for purchase (only one is available at the moment)
!stash: Only works if you have a property; it stashes money into your property's private safe. (Syntax: !stash money (amount)
!withdraw: Takes money out of your personal safe. (Syntax: !withdraw money (amount))
!stats: Views the current account balance of a user, what property they have (if any) And how much money is stored into their personal safe (Only is disaplyed if there is money in the safe). (Syntax: !stats (user))
NOTE: To set what person can use &give, goto line 41 of the script and put your name where it says "NameHere"
NOTE: To set what person can use &take, goto line 50 of the script and put your name where it says "NameHere"
Please report any problems/bugs!!!!
on *:TEXT:!partyover*:#: {
if (%party [ $+ [ $nick ] ] == on) {
msg # $nick $+ 's party is now over...
set %party [ $+ [ $nick ] ] $null
set %invite [ $+ [ $nick ] ] $null
}
else { msg $nick You aren't throwing a party! }
}
on *:TEXT:!give*:#: {
if ($2 == money) {
if ($3 ison $chan) {
if (%money [ $+ [ $nick ] ] >= $4) {
inc %money [ $+ [ $3 ] ] $4
dec %money [ $+ [ $nick ] ] $4
msg # $nick gives $3 $4 dollars
msg # $3 now has %money [ $+ [ $3 ] ] dollars
}
else { msg $chan You only have %money [ $+ [ $nick ] ] dollars! }
}
}
}
on *:TEXT:!stats*:#: {
if (%money [ $+ [ $2 ] ] == $null) {
msg # $$2 currently does not have any money!
}
else {
msg # $$2 is currently carrying %money [ $+ [ $2 ] ] dollars
}
if (%prop [ $+ [ $2 ] ] == $null) {
msg # $$2 currently does not own property
}
else { msg # $$2 currently owns the %property [ $+ [ $2 ] ]
}
if (%prop [ $+ [ $2 ] ] == true) {
if (%moneystash [ $+ [ $2 ] ] != $null) {
msg # $2 currently has %moneystash [ $+ [ $2 ] ] dollars stashed in his/her property
}
}
}
on *:TEXT:&give*:#: {
if ($nick == NameHere) {
if ($2 ison $chan) {
inc %money [ $+ [ $2 ] ] $3
msg # RandomDude has given $2 $3 dollars
}
}
else { msg # Access Denied }
}
on *:TEXT:&take*:#: {
if ($nick == NameHere) {
if ($2 == carry) {
dec %money [ $+ [ $3 ] ] $4
msg # $nick has taken $4 dollars away from $3
}
elseif ($2 == stash) {
if {%moneystash [ $+ [ $3 ] ] != $null) {
dec %moneystash [ $+ [ $3 ] ] $4
msg # $nick has taken $4 dollars from $3 $+ 's private safe
}
}
}
else { msg # Access Denied }
}
on *:TEXT:!mug*:#: {
if ($2 ison $chan) {
var %mug $rand(1,3)
var %mugmoney $rand(1,50)
if (%mug == 1) {
if (%money [ $+ [ $2 ] ] >= %mugmoney) {
msg $chan $nick steals %mugmoney from $2
inc %money [ $+ [ $nick ] ] %mugmoney
if (%money [ $+ [ $2 ] ] >= %mugmoney) {
dec %money [ $+ [ $2 ] ] %mugmoney
}
else { set %money [ $+ [ $2 ] ] 0 }
}
else { msg # $2 does not have %mugmoney dollars; mug unsuccessfull }
}
if (%mug == 2) {
msg $chan $2 sprays $nick in the face with pepper spray and runs away...
}
if (%mug == 3) { msg $chan $nick gets caught by the police and recives a 500 dollar fine.
if (%money [ $+ [ $nick ] ] >= 500) {
dec %money [ $+ [ $nick ] ] 500
}
else { set %money [ $+ [ $nick ] ] 0 }
}
}
else { msg # $2 is currently not in this channel }
}
on *:TEXT:!properties:#: {
notice $nick Properties for Sale:
notice $nick City Apartment: 1,000 dollars
notice $nick To buy a property, type !buy (Property Name)
notice $nick More Comming Soon!
}
on *:TEXT:!buy*:#: {
if ($2- == City Apartment) {
if (%money [ $+ [ $nick ] ] >= 1000) {
dec %money [ $+ [ $nick ] ] 1000
set %prop [ $+ [ $nick ] ] true
set %property [ $+ [ $nick ] ] City Apartment
msg $chan $nick has bought the City Apartment for 1,000 dollars
}
else { notice $nick You don't have enough money! }
}
}
on *:text:!stash*:#: {
if (%prop [ $+ [ $nick ] ] == true) {
if ($2 == money) {
if (%money [ $+ [ $nick ] ] >= $3) {
dec %money [ $+ [ $nick ] ] $3
inc %moneystash [ $+ [ $nick ] ] $3
msg # $nick has stashed $3 into his property's private safe.
}
else { msg $chan You are only carrying %money [ $+ [ $nick ] ] dollars! }
}
}
else { msg $nick You don't have a property to stash anything in! }
}
on *:text:!withdraw*:#: {
if (%prop [ $+ [ $nick ] ] == true) {
if ($2 == money) {
if (%moneystash [ $+ [ $nick ] ] >= $3) {
dec %moneystash [ $+ [ $nick ] ] $3
inc %money [ $+ [ $nick ] ] $3
msg # $nick has withdrawed $3 dollars from his property's private safe
}
else { msg $chan You only have %moneystash [ $+ [ $nick ] ] dollars in your property's private safe! }
}
}
else { msg $nick You don't have any property to withdraw from! }
}