Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is this Health Bar Gui not being affected?

Asked by 2 years ago

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

Log in to vote
0
Answered by 2 years ago

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

Ad

Answer this question