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

Why is this Health Bar Gui not being affected?

I am trying to make a bar go down when something is clicked but when it is clicked there is no error and nothing changes, what is the problem?

Hits = 10

function Clicked(player)
	local Gui = player.PlayerGui.ScreenGui.Damage
	local Green = Gui.Green
	local XScale = Green.Size.X.Scale
	local DecreasePerHit = 0.957 / Hits
	
	XScale = XScale - DecreasePerHit
end

Rock.ClickDetector.MouseClick:Connect(Clicked)

1 answer

✓ Accepted answer

Use RemoteEvents because setting GUI in a server script won’t work since GUIs can only be accessed by the client to prevent hacks.

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