so, I have tried to make my own custom health GUI, yet it isnt working when I test it. Can you help me out? My Script is here:

wait(2)
game.Players.LocalPLayer.Character.Humanoid.Changed:connect(function()
local redzone = game.Players.LocalPlayer.Character.Humanoid.MaxHealth/4
if game.Players.LocalPlayer.Character.Humanoid.Health <= redzone then
script.Parent.BackgroundColor3 = 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
	script.Parent.BackgroundColor3 = Color3
end	


	script.Parent.Size = UDim2.new(game.Players.LocalPlayer.Character.Humanoid.Health/game.Players.LocalPlayer.Character.Humanoid.MaxHealth,0,0,20)
script.Parent.Parent.TextLabel.Text = math.floor(game.Players.LocalPlayer.Character.Humanoid.Health)
end)

I also turned off ResetPlayerGuiOnSpawn

Please Help!

10 comments

4

codeblocks pls

0

Just copy and paste it

2

Hell no. You put it in a codeblock first.

0

why

2

Two words. Code. Block.

1

cough code cough cough block mofo cough

1

We can barely understand the code, there's no separation between lines, and it's really messy. If you put it in code blocks format you can use your formatting for the original code and it'll make it actually readable. As soon as you change the format of your code to a code block, we can help you.

0

You need to click the Lua button (right-most one) and copy/paste your code into what appears (in between the two lines of ~~~~s).

0

Thankyou chess123!

1

;-;