I made a GUI and was trying to tween it based on the player’s current stats. However, the tweeting causes the bar to move left rather than tween within the frame.
local TW = game:GetService("TweenService")
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local BusoHakiBar = script.Parent
local function UpdateBusoHakibar()
local Haki = math.clamp(Character:GetAttribute("BusoHakiTime") / Character:GetAttribute("MaxBusoHakiTime"), 0, 1)
local info = TweenInfo.new(Character:GetAttribute("BusoHakiTime") / Character:GetAttribute("MaxBusoHakiTime"),Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0)
TW:Create(script.Parent,info,{Size = UDim2.fromScale(Haki, 1)}):Play()
end
Character:GetAttributeChangedSignal("BusoHakiTime"):Connect(UpdateBusoHakibar)