So I'm trying to make a script where if the Current value is at 100 then the player dies, the script at the bottom is what I'm currently using to do it but the player only dies once and it never kills the player after that.
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:connect(function(Char)
local level = Instance.new("IntValue", player)
level.Name = "Level"
level.Value = 1
local exp = Instance.new("IntValue", level)
exp.Name = "Current"
exp.Value = 0
local maxExp = Instance.new("IntValue", level)
maxExp.Name = "Max"
maxExp.Value = 100
local truevalue = Instance.new("BoolValue", player)
truevalue.Name = "TrueValue"
truevalue.Value = false
exp.Changed:Connect(function(val)
if exp.Value >= maxExp.Value then
Char.Humanoid.Health = 0
player.Level.Current.Value = 0
end
end)
end)
end)
