Alright, so I am making a realistic roleplay game and need help with the bank deposit script I will provide you with the script,developer logs,in-game GUI,explorer and the money leaderboard script.
Deposit script:
player = script.Parent.Parent.Parent.Parent.Parent
money = player.Money.Value
bank = player.BankedMoney.Value
withdraw = script.Parent.Parent.MoneyValue
withdrawcash = script.Parent.Parent.MoneyValue.Value
function hi()
if money.Value <= withdrawcash then
bank.Value = withdraw.Value+bank.Value
money.Value = money.Value-withdraw.Value
script.Parent.Parent.Visible = false
script.Parent.Parent.Parent.Good.Visible = true
else
script.Parent.Parent.Visible = false
script.Parent.Parent.Parent.Error.Visible = true
end
end
script.Parent.MouseButton1Down:connect(hi)
Developer Logs: https://gyazo.com/bd33ac825c6dd45516d82bf97275751a
In-Game GUI: https://gyazo.com/ebcf57ae6c9841d33dc85872f41e598e
Explorer: https://gyazo.com/586a7ea0a170a0aa1c16bfa37bfa2133
Money LeaderBoard Script:
print("Money Leaderboard Working")
game.Players.PlayerAdded:connect(function(np)
local value = Instance.new("IntValue")
value.Name = "Money"
value.Parent = np
local value = Instance.new("IntValue")
value.Name = "BankedMoney"
value.Parent = np
end)
If you could also include the problem and explain so that I may learn from my mistakes.

1 comment
Did not work I think the problem is Line 8