I am trying to make it where if the player dies, the currency amount will go + 1 as stated in the title. But the problem is, after the humanoid dies, the currency DOES go up 1 but for only a second and resets back to its normal. If that makes more clear. Full code is listed below.
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character
local TweenService = game:GetService("TweenService")
local CurrencyUI = Player.PlayerGui:WaitForChild("Currency")
local MoneySign = CurrencyUI.Frame:WaitForChild("MoneySign")
local Amount = CurrencyUI.Frame:WaitForChild("Amount")
repeat
wait()
Character = Player.Character
until Character ~= nil
local Humanoid = Character:WaitForChild("Humanoid")
Humanoid.Died:Connect(function()
Amount.Text += 1
end)

1 comment
There is no data store in the game yet