Hello, I’m making a system that destroys the old value and replace it with a new value every time the player respawns, but I don’t know how.
Here is the Script:
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
if player and character then
local Died = Instance.new("BoolValue", player)
Died.Name = "Died"
Died.Value = false
end
end)
end)
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
if player and character then
local died = player:FindFirstChild("Died")
if died then
died:Destroy()
end
local Died = Instance.new("BoolValue", player)
Died.Name = "Died"
Died.Value = false
end
end)
end)