Problem with Tween

I’m currently trying to make the Platform Part go from the Start to the Destination via a tween. For some reason, it keeps giving me this error:

“11:59:42.507 TweenInfo.new first argument expects a number for time. - Server - MoverScript:13”

I don’t know why it gives me that error since my first argument is the value of MoveTime, which is a Number Value.

Here’s the explorer and the script itself, help would be appreciated.

Capture

local TweenService = game:GetService("TweenService")

local Destination = script.Parent.Destination

local x = script.Parent.Platform

local Time = script.MoveTime.Value

local WaitTime = script.WaitTime.Value

local TI = TweenInfo:new(
	
	Time,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.In,
	-1,
	true,
	WaitTime
	
)

local Goals = {
	
	CFrame = Destination.CFrame
	
}

local Tween = TweenService:Create(x, TI, Goals)

Tween:Play()
TweenInfo:new(...)

Using a colon to call the function will automatically pass a value into it. But .new can’t really understand that.

TweenInfo.new()

You want to use a period instead since that doesn’t automatically add information.

1 Like

Alright, I tried it and it works. Thank you very much. (I’m stupid)

1 Like