#Gui draining from the wrong direction

10 messages · Page 1 of 1 (latest)

delicate trench
#

im trying to get a bar to drain right to left but it is draining from top to bottom

#
local players = game:GetService("Players")
local char = players.LocalPlayer.Character or players.LocalPlayer.CharacterAdded:Wait()
local oxy = char:WaitForChild("Oxygen")
local maxoxy = char:WaitForChild("MaxAir")
local gui = script.Parent

local run = game:GetService("RunService")
run.Heartbeat:Connect(function()
    gui.Bar.Display.Text = (math.round(oxy.Value) .. "%")
    gui.Bar.Slider.Size = (UDim2.new(1,0, oxy.Value/char.MaxAir.Value,0))
    
end)
lusty storm
#

the (oxy.Value/char.MaxAir.Value,) portion seems to be on the yScale parameter rather than the xOffset which is where the first 0 is. I'm inexperienced, so take this with a grain of salt.

toxic flint
delicate trench
#

@toxic flint just gonna say it now, thanks for helping me a ton, i really appreciate it

#

@toxic flint btw, its draining from the wrong side

toxic flint
#

what do you mean.

delicate trench
#

i want it to drain from the right

#

but its draining from the left

toxic flint
#

set the anchor point to 1,0 and position to 1,0,0,0