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

GUI is going off the screen everytime it changes. Help?

Asked by 5 years ago

So I have this script for a health bar:

wait(1)

local plr = game.Players.LocalPlayer
local hum = game.Players.LocalPlayer.Character.Humanoid


hum.HealthChanged:connect(function(health)
    script.parent.Size = UDim2.new(health/hum.MaxHealth,0,1,0)
end)

And it works until your health changes. Then it goes off the screen horizontally and vertically. Any help?

0
try using vector2 instead of UDM DragRacer31 7 — 5y
0
do I use vector2 for X or Y? the bar is horizontal on the screen SkyAlt33Vincent 2 — 5y
0
i tried it for both, it says "X cannot be assigned" or "Y cannot be assigned" SkyAlt33Vincent 2 — 5y
0
try changing line 8 to script.Parent.Size = UDim2.new(0, health/hum.MaxHealth, 0, 10) GoldAngelInDisguise 297 — 5y

Answer this question