Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Once the player dies, the currency will add up for for one second it resets back to 0?

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

0

There is no data store in the game yet

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.