Hi there.
For some reason, when this runs, it completely skips the two seconds that the tween is supposed to be running for. it does it instantaneously. Any ideas?
mouse.Button1Down:Connect(function() animTrack:Play() stop = false while stop == false do wait() for _,iore in ipairs(ore) do if cursorObject.Parent.Name == iore and magnitude <= 10 and hit == false and cursorObject.Parent.Health.Value > 0 then hitting = true hit = true local current = cursorObject.Parent.Name local currenthealth = replicatedstorge:WaitForChild("Health"):InvokeServer(current) local function executeAfter(complete) print("hello") replicatedstorge:WaitForChild("Mining"):FireServer(cursorObject,damage) progress.Size = UDim2.new(0,0,1,0) hit = false end local tween2 = progress:TweenSize( UDim2.new(1,0,1,0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, false, 2, executeAfter ) end end end end)
Hello, FierceLeviathan.
Upon further examination of your code, one thing that definitely sticks out as an issue is that you put:
local tween2 = progress:TweenSize( UDim2.new(1,0,1,0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, false, 2, executeAfter )
The main issue here is that the parameters of TweenSize are endSize, easingDirection, easingStyle, time, override, and callback.
With that being said, your code should look more like this:
local tween2 = progress:TweenSize( UDim2.new(1,0,1,0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 2, false, executeAfter )
Best of luck!