So i was making my game when i ran into an unexpected proplem that wasnt even in error log
anway
Experimental mode : off Filtering enabled = on
my code for costume health
local plr = game.Players.LocalPlayer plr.CharacterAdded:Connect(function(character) local Humanoid = plr.Character:WaitForChild("Humanoid") local HG = script.Parent local Text = HG:WaitForChild("Back"):WaitForChild("Text") local hlth = Humanoid.Health local mxhlth = Humanoid.MaxHealth Humanoid.Health.Changed:Connect(function() Text:TweenSize(UDim2.new(hlth/mxhlth,0, 1,0), "Out", "Linear", .2, true) end) end)
also can someone tell me why regeneration script wont work? i have made a script to see if its disabled when the player enters but no still no work
i am talking about the "health" script when the player character is ingame``
Try this:
local plr = game.Players.LocalPlayer plr.CharacterAdded:Connect(function(character) local Humanoid = character:WaitForChild("Humanoid") local HG = script.Parent local Text = HG:WaitForChild("Back"):WaitForChild("Text") Humanoid.Health.Changed:Connect(function() local Math = Humanoid.Health / Humanoid.MaxHealth Text:TweenSize(UDim2.new(Math,0, 1,0), "Out", "Linear", 0.2, true) end) end)
The reason it didn't work is because you made a variable for health and maxhealth meaning that the values always stayed the same. Though the health is changing since the value is the same your "text" doesn't change.
Hopefully, this helped.
Best of luck developer!