UI element isn't tweening even though all elements in the script are valid

So basically what i want to achieve is that i want the “Time” UI to tween once the event fires, with the tween duration being the number received with the event.

-- Server Script
local repstorage = game:GetService("ReplicatedStorage")
local tweenevent = repstorage:WaitForChild("CountdownTween")

workspace.CoreFolder.Countdown.CountTo0.Enabled = true
local registeredtime = 240
tweenevent:FireAllClients(registeredtime)
-- Client Script
local repstorage = game:GetService("ReplicatedStorage")
local tweenevent = repstorage:WaitForChild("CountdownTween")
local ts = game:GetService("TweenService")

local function tweenEvent(registeredtime)
	local tinfo = TweenInfo.new(registeredtime, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut)
	script.Parent.Time.Position = UDim2.new(0, 0, 0, 0)
	local tween = ts:Create(script.Parent.Time, tinfo, {Position = UDim2.new(-1, 0, 0, 0)})
	tween:Play()
end

tweenevent.OnClientEvent:Connect(tweenEvent)

Do note that the problem here is only the tweening part, everything else works as intended.

in the ui elements you can just use :TweenSize, :TweenPosition or :TweenSizeAndPosition, no need of tween service

Alright, but if possible can you provide a example?

As I understand

local part = script.Parent
local TweenServer = game:GetService("TweenService")
local TweenLop = TweenInfo.new(3)

local Target = {part.TweenSize == Vector3.new(30,30,20)
}

I thing its like this {Dont try this script i thing its not work}

local whateveryourframeoruielement = script.Parent.Frame -- choose ur different path

local function tweenEvent()
	whateveryourframeoruielement:TweenPosition(UDim2.new("INSERT POSITION"), "InsertEasingDirection", "InsertEasingStyle", "Time")
	whateveryourframeoruielement:TweenSize(UDim2.new("WHATEVER UR SIZE IS"), "InsertEasingDirection", "InsertEasingStyle", "Time")
	whateveryourframeoruielement:TweenSizeAndPosition(UDim2.new("FIRSTTHESIZE"), UDim2.new("POSITION"), "InsertEasingDirection", "InsertEasingStyle", "Time")
end

-- do note that EasingDirection and Style must be in quotaion marks

also dont mind the bad grammar, i tried to do it fast

Are you sure that it is not tweening? A 4 minute tween might just look like it isnt moving.
Also what is “Time” in script.Parent.Time?

It’s the UI element to be tweened. And it is not tweening, i watched it. (yes, i stood still for 4 minutes for nothing.)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.