Ok so this serverscript is in serverscriptservice and when i play it, it keeps showing me this error saying that 18:58:50.980 - ServerScriptService.Script:18: attempt to index field 'Health' (a number value)
heres my script
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(char) BillBoardGui = game.Workspace:WaitForChild(player.Name).Head:WaitForChild('BillboardGui') local ServerStorage = game:GetService("ServerStorage") local Red = BillBoardGui.REDNess local Green = Red.GreenESS local Hum = char.Humanoid Hum.Health.HealthChanged:Connect(function(HealthChanged) Red:TweenSize(UDim2.new(HealthChanged/Hum.MaxHealth,0,1,0)) end) end) end)
HealthChanged is an event of humanoid.
So just do Hum.HealthChanged
instead of Hum.Health.HealthChanged