TweenService not working

Hello Developers.
Today I was trying to make an intro for my game, and I wanted my logo to wave so I used TweenService to rotate my logo, But when I checked if everything was working in output it said " TweenInfo.new fourth arg should be a number for RepeatCount." And I am new at scripting so I don’t understand this error much. This is just the start of my intro but if anyone knows how to fix this please reply. here is my script:

local Ghost = script.Parent
local Speed = 0.9
local Side = false
local Blink = 0

local ts = game:GetService("TweenService")
local rotate1 = ts:Create(Ghost, TweenInfo.new(0.9, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, {Rotation = 30}))
local rotate2 = ts:Create(Ghost, TweenInfo.new(0.9, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, {Rotation = -30}))

while true do
		if Side == true then
		    Ghost:TweenPosition(UDim2.fromScale(0.5,0.4),"InOut","Quad",Speed,true)
		    rotate1:Play()
		else
		    Ghost:TweenPosition(UDim2.fromScale(0.5,0.6),"InOut","Quad",Speed,true)
		    rotate2:Play()
		end
		
	Side = not Side
	wait(Speed)
end

have a nice day.

1 Like

TweenInfo.new() requires multiple values.

Argument 1 is a number to represent the time the tween should take
Argument 2 is an Enum to represent the easing function/style
Argument 3 is an Enum to represent the easing direction
Argument 4 is a number to represent the times it should repeat (Negative values will repeat infinitely)
Argument 5 is a number to represent the delay between repeats.

TweenInfo.new() is not where you declare which properties to Tween. Right now it’s current in the TweenInfo.new() table.

From what the error is saying, the fourth argument where you put Rotation = 30 must be the argument for the number of times this Tween is going to be repeated. e.g., if you put the number 2 in the fourth argument, it will repeat 2 times.