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

Nothing is in the output and I'm Trying to make a help bar. Whats wrong with it?

game.Players.LocalPlayer.Character.Humanoid.Health.Changed:connect(function()
	local health = game.Players.LocalPlayer.Character.Humanoid.Health
	local healthbar = game.StarterGui.HealthandKiGUI.BackOfHealth.Healthbar
	if health < 100 then
		healthbar.Size = UDim2.new(1, 0, 1, 0) - UDim2.new(0, 0, health/0.01, 0)
	end
end)

What is wrong with it?

2 comments

0

To display anything to the output for debugging you need to use print(Tuple params) like print("any text and data if you concatenate it to the string")

0

health/maxhealth?

1 answer

You are editing the StarterGui, which is the original gui that is cloned into player's PlayerGuis, not the gui being displayed to the player. So, you actually want healthbar to be game.Players.LocalPlayer.PlayerGui.HealthandKiGUI.BackOfHealth.Healthbar

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