wait(game.Lighting.TimeToLoad.Value) -- Health Bar local HealthB = script.Parent.bk.HBar repeat until game.Players.LocalPlayer.CharacterAdded:Wait() game.Players.LocalPlayer.Character.Humanoid:GetPropertyChangedSignal("Health"):Connect(function() local redzone = game.Players.LocalPlayer.Character.Humanoid.MaxHealth / 2 if game.Players.LocalPlayer.Character.Humanoid.Health <= redzone then HealthB.ImageColor3 = Color3.new(255, 0, 0) end if game.Players.LocalPlayer.Character.Humanoid.Health > redzone then local brickcolor = BrickColor.new("Lime green") local color = brickcolor.Color HealthB.ImageColor3 = color end HealthB.Size = UDim2.new(game.Players.LocalPlayer.Character.Humanoid.Health / game.Players.LocalPlayer.Character.Humanoid.MaxHealth, 0, 0, 20) end)
You cannot add a Changed
event to a property like that. It just won't work.
The way to do it is as follows:
game.Players.LocalPlayer.Character.Humanoid:GetPropertyChangedSignal("Health") :Connect(function()
repeat until game.Players.LocalPlayer.CharacterAdded:Wait()
repeat until
are completely unnecessary and are also permanently running, preventing your event from connecting.