I wrote this money system script, and I don't have access to a computer to test it. It would be awesome if someone could test it for me.
Copper, Silver, and Gold are IntValues within a GUI:
local CC = script.Parent.Copper.Value
local SC = script.Parent.Silver.Value
local GC = script.Parent.Gold.Value
function MoneySystem(silver)
if CC.Value >= 50 then
CC.Value = CC.Value - 50
SC.Value = SC.Value + 1
end
end
function MoneySystem(gold)
if SC.Value >= 500 then
SC.Value = SC.Value - 500
GC.Value = GC.Value + 1
end
end
script.Parent.Copper.Value.Changed:connect(silver)
script.Parent.Silver.Value.Changed:connect(gold)
|