Greetings and salutations! My name is Wes and I am on a quest to make a StaminaBar’s Frame become invisible when its X Scale reaches 0. To be honest, I am confused. Please help me. Thank you!
Reason Why:
local gui = Players.LocalPlayer.PlayerGui.StaminaGui.Frame
local bar = gui:FindFirstChild("StaminaBar", true)
local invisiblecheck = true
if bar.Size == UDim2.new(0,0,1,0) then
if invisiblecheck == true then
invisiblecheck = false
bar.Visible = false
wait(1)
bar.Visible = true
invisiblecheck = true
end
end
local gui = Players.LocalPlayer.PlayerGui.StaminaGui.Frame
local bar = gui:FindFirstChild("StaminaBar", true)
local invisiblecheck = true
bar:GetPropertyChangedSignal("Size"):Connect(function()
if bar.Size == UDim2.new(0,0,1,0) then
if invisiblecheck == true then
invisiblecheck = false
bar.Visible = false
wait(1)
bar.Visible = true
invisiblecheck = true
end
end
end)
Every time bar.Size changes it will check if it has reached (0, 0, 1, 0) and make bar invisible.