Spoiler yourmon = {}
use = 1
first = {}
copyright=string.char(169)
addhook ("spawn","span")
function span(id)
if yourmon[id]==nil then
yourmon[id] = 0
end
if first[id] == nil then
first[id] = 111111
if (io.open("user/"..player(id,"usgn")..".txt")~=nil) then
msg2 (id,""..copyright.."000255000Loaded!")
for l in io.lines("user/"..player(id,"usgn")..".txt") do
mof = tonumber(l)
if mof ~=nil then
yourmon[id] = mof
end
end
else
msg2 (id,""..copyright.."255000000Sorry, no savefile found!")
end
end
end
addhook ("serveraction","ser")
function ser(id,ac)
if (ac==1 and use==1) then
goldmenu(id)
end
end
function goldmenu(id)
checkk = player(id,"money")+yourmon[id]
menu (id,"drop money,100,500,1000,2000,5000,10000,15000,20000,you have:"..checkk.."$")
end
addhook ("menu","meno")
function meno(id,menu,sel)
if (menu=="drop money") then
if sel>=1 and sel<=9 then
goldmenu(id)
end
if yourmon[id]~= nil then
checkmonx = player(id,"money")+yourmon[id]
yourmon[id] = yourmon[id] + player(id,"money")
parse ("setmoney "..id.." 0")
else
checkmonx = ""
end
if sel==1 and checkmonx >=100 then
parse ("spawnitem 66 "..(player(id,"tilex")).." "..(player(id,"tiley")))
yourmon[id] = yourmon[id] - 100
end
if sel==2 and checkmonx >=500 then
parse ("spawnitem 67 "..(player(id,"tilex")).." "..(player(id,"tiley")))
yourmon[id] = yourmon[id] - 500
end
if sel==3 and checkmonx >=1000 then
parse ("spawnitem 68 "..(player(id,"tilex")).." "..(player(id,"tiley")))
yourmon[id] = yourmon[id] - 1000
end
if sel==4 and checkmonx >=2000 then
yourmon[id] = yourmon[id] - 2000
parse ("spawnitem 68 "..(player(id,"tilex")).." "..(player(id,"tiley")))
parse ("spawnitem 68 "..(player(id,"tilex")).." "..(player(id,"tiley")))
end
if sel==5 and checkmonx >=5000 then
yourmon[id] = yourmon[id] - 5000
for i=1,5 do
parse ("spawnitem 68 "..(player(id,"tilex")).." "..(player(id,"tiley")))
end
end
if sel==6 and checkmonx >=10000 then
yourmon[id] = yourmon[id] - 10000
for i=1,10 do
parse ("spawnitem 68 "..(player(id,"tilex")).." "..(player(id,"tiley")))
end
end
if sel==7 and checkmonx >=15000 then
yourmon[id] = yourmon[id] - 15000
for i=1,15 do
parse ("spawnitem 68 "..(player(id,"tilex")).." "..(player(id,"tiley")))
end
end
if sel==8 and checkmonx >=20000 then
yourmon[id] = yourmon[id] - 20000
for i=1,20 do
parse ("spawnitem 68 "..(player(id,"tilex")).." "..(player(id,"tiley")))
end
end
end
end
addhook ("join","jo")
function jo(id)
yourmon[id] = 0
end
addhook ("second","sec")
function sec()
for id=1,32 do
if(player(id,"exists")) then
if yourmon[id] ~= nil then
hud(id)
checkk = player(id,"money")+yourmon[id]
if checkk~=nil and checkk<10000 then
yourmon[id] = 0
parse ("setmoney "..id.." "..checkk)
hud(id)
end
end
if (player(id,"money")>10000) then
chec = player(id,"money") - 10000
parse ("setmoney "..id.." "..(player(id,"money")-chec))
yourmon[id] = yourmon[id] + chec
end
if(player(id,"money")<10000) then
chec = 10000 - player(id,"money")
if yourmon[id]~=nil then
if yourmon[id] >=chec then
yourmon[id] = yourmon[id] - chec
parse ("setmoney "..id.." "..(player(id,"money")+chec))
hud(id)
end
end
end
end
end
end
function hud(id)
txt = (""..copyright.."000255000Money(+10000):"..yourmon[id].."$")
x = 15
y = 430
idd = 15
parse('hudtxt2 '..id..' '..idd..' "'..txt..'" '..x..' '..y)
end
addhook ("walkover","walken")
function walken(id,iid,type,ain,a,mode)
if (type==66) then
if player(id,"money")>=100 then
yourmon[id] = yourmon[id] + 100
parse ("setmoney "..id.." "..player(id,"money")-100)
end
elseif (type==67) then
if player(id,"money")>=500 then
yourmon[id] = yourmon[id] + 500
parse ("setmoney "..id.." "..player(id,"money")-500)
end
elseif (type==68) then
if player(id,"money")>=1000 then
yourmon[id] = yourmon[id] + 1000
parse ("setmoney "..id.." "..player(id,"money")-1000)
end
end
end
addhook ("leave","left")
function left(id)
yourmon[id] = 0
first[id] = nil
end
addhook ("say","sages")
function sages(id,txt)
if txt=="!save" then
yourmon[id] = yourmon[id] + player(id,"money")
parse ("setmoney "..id.." 0")
io.output(io.open("user/"..player(id,"usgn")..".txt","w+"))
io.write(yourmon[id])
io.close()
msg2 (id,""..copyright.."000255000Saved!@C")
end
end
addhook ("minute","min")
function min()
for id=1,32 do
if player(id,"exists") then
yourmon[id] = yourmon[id] + player(id,"money")
parse ("setmoney "..id.." 11000")
io.output(io.open("user/"..player(id,"usgn")..".txt","w+"))
io.write(yourmon[id])
io.close()
end
end
hud(id)
end
addhook("die","classesoptdie")
function classesoptdie()
return 1
end