Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

right health script?

You would put this on as one of the scripts for a health GUI right?

local char = workspace:findFirstChild(script.Parent.Parent.Parent.Name)
hum = char.Humanoid
hum.Changed:connect(function()
	script.Parent.Frame.Health.Frame.Size = UDim2.new(hum.Health/hum.MaxHealth,0,1,0)
	if hum.Health <= hum.MaxHealth*0.15 then
		script.Parent.Frame.Health.Frame.BackgroundColor3 = Color3.new(150,0,0)
	else
		script.Parent.Frame.Health.Frame.BackgroundColor3 = Color3.new(0,170,0)
	end
end)

1 comment

0

This is a script for a health gui, yes. Make sure you have the necessary requirements before attempting to use it.

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.