So the system that increases money adds 5 (Currency) every 60 seconds. But after the money has been added from the increase system. It does not work, It just goes back to 0.
Increase system: [LocalScript in the HUD GUI]
local player = game.Players.LocalPlayer
local team = game.Teams
local I_R = script.Parent.Income_Role
local leaderboard = player.Leaderboard
local MoneyFlow = 5
if player.Team == team.white
then
while true do
wait(5)
I_R.Amount.Text = "£10"
I_R:TweenPosition(UDim2.new(0.785, 0,0.115, 0),"In", "Back")
wait(1)
leaderboard.Bank.Value = leaderboard.Bank.Value + 10
wait(2.5)
I_R:TweenPosition(UDim2.new(1, 1,0.115, 0),"Out", "Back")
end
end
Saving System: [Script in ServerScriptService]
local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("MoneyStats")
--// Creating Value's System
game.Players.PlayerAdded:Connect(function(Player)
local leaderboard = Instance.new("Folder", Player)
leaderboard.Name= "Leaderboard"
local Bank= Instance.new("IntValue", leaderboard)
Bank.Name = "Bank"
Bank.Value = 0
local Wallet= Instance.new("IntValue", leaderboard)
Wallet.Name = "Wallet"
Wallet.Value = 0
local Food= Instance.new("IntValue", leaderboard) --// Ignore this
Food.Name = "Food"
Food.Value = 100
local Data = DataStore:GetAsync(Player.UserId)
if Data then
Bank.Value = Data.Bank
Wallet.Value = Data.Wallet
end
end)
--// Saving Value's System
game.Players.PlayerRemoving:Connect(function(Player)
DataStore:SetAsync(Player.UserId, {
["Bank"] = Player.Leaderboard.Bank.Value;
["Wallet"] = Player.Leaderboard.Wallet.Value;
})
end)

3 comments
Also replace all of my quotation marks because my keyboard is weird.
Sadly this does not work. I have done what you said and fixed the quotations but it does not work and i do not get a error
Nevermind It Does work i just messed it up myself Thank you :)