#Gui draining from the wrong direction
10 messages · Page 1 of 1 (latest)
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)
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.
gui.Bar.Slider.Size = UDim2.new(oxy.Value/char.MaxAir.Value,0,1,0)
@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
what do you mean.
set the anchor point to 1,0 and position to 1,0,0,0