I want to try a way to fix this error, so this is my script
local Player = game:GetService("Players").LocalPlayer
local char = Player.Character or Player.CharacterAdded:Wait()
repeat
wait()
until char:FindFirstChild("UltimateMax")
repeat
wait()
until char:FindFirstChild("UltimateValue")
local ultvalue = char:FindFirstChild("UltimateValue")
local ultmax = char:FindFirstChild("UltimateMax")
while true do
wait()
local endSize = UDim2.new(ultvalue / ultmax,0,1,0) -- this line error
script.Parent.UltimateBar:TweenSize(endSize, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.5, true)
end
while true do
wait()
local endSize = UDim2.new(ultvalue / ultmax,0,1,0) -- this line error
script.Parent.UltimateBar:TweenSize(endSize, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.5, true)
end
Youâre performing the tween every 2 frames.
Increase the yield to match the tweenâs length, i.e; task.wait(0.5) at the start of the loop.
local Player = game:GetService("Players").LocalPlayer
local char = Player.Character or Player.CharacterAdded:Wait()
local ultvalue = char:WaitForChild("UltimateValue").Value
local ultmax = char:WaitForChild("UltimateMax").Value
while true do
task.wait(.5)
local endSize = UDim2.new(ultvalue / ultmax, 0,1,0)
script.Parent.UltimateBar:TweenSize(endSize, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.5, true)
end