How do I create 2 separate tweeninfo variables?

This errors, I can’t call a variable anything else that holds tweeninfo, other than “TweenInfo”?

local TweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out) -- Tween info for the size change
local TweenInfoReturn = TweenInfo.new(1.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out) -- Tween info for the size change

Try

local TweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out) -- Tween info for the size change

local TweenInfoReturn = TweenInfo.new(1.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out) -- Tween info for the size change

Sometimes something as simple as a line down can fix it

Yea no sadly. Its giving me this error:

 'new' is not a valid member of TweenInfo  -  Client - control:204

 Stack Begin  -  Studio
  21:08:33.443  Script 'Workspace.matt1020304050.control', Line 204  -  Studio - control:204
  21:08:33.443  Stack End  -  Studio

I dont really know then…If I think of anything ill tell you. Maybe try New instead of new? I dont know really

You named your first variable TweenInfo, try changing it to something else.

1 Like

Yea I renamed both, and now it works. Weird.

1 Like

This is because you assign TweenInfo.new(...) to the word TweenInfo on the first line and on the second line,

the script treats the word TweenInfo, as if it is the variable you previously created and not as the reserved word you meant it to be. So the value of the second variable turns out to be TweenInfo.new(...).new(...) which will obviously error. By renaming the first variable to something other than TweenInfo, the reserved word keeps its meaning.

2 Likes

I see…Thank you for information, I know very little about this topic

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