Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local stop
- local ID
- local amount
- local protocol
- stop = 0
- rednet.open("right")
- repeat
- ID, amount, protocol = rednet.receive()
- print([[ATM: ]] .. ID .. [[ | AMOUNT: ]] .. amount .. [[ | PROTOCOL: ]] .. protocol)
- if protocol == "atm.buy" then
- commands.exec([[paidcommand @p[x=-21,y=4,z=0,r=1] ]] .. amount .. [[ give @p[x=-21,y=4,z=0,r=1] 4269 ]] .. amount)
- elseif protocol == "atm.sell" then
- commands.exec([[sellcommand @p[x=-21,y=4,z=0,r=1] 4269 ]] .. amount .. [[ 0 wallet @p[x=-21,y=4,z=0,r=1] add ]] .. amount)
- elseif protocol == "atm.stop" then
- if amount == "andromeda25" then
- rednet.send(ID,"OKAY","atm.stop")
- else
- rednet.send(ID,"NO","atm.stop")
- commands.exec("say [SERVER] @p[x=-21,y=4,z=0,r=1] HAS ATTEMPTED TO BREACH AN ATM ON THE NETWORK.")
- commands.exec("tp @p[x=-21,y=4,z=0,r=1] 0 255 0")
- end
- else
- print("Protocol error!")
- rednet.send(ID,"Incorrect ATM protocol!","atm")
- end
- until stop == 1
- rednet.close("right")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement