Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Please help. I have idea what this output means can someone help me? it about tween

so it says Players.TypicalVictorlks.PlayerGui.Menu.MenuMain:14: attempt to call a TweenInfo value. So um what does that mean and what do i need to fix to my script?

wait(5)

--services
local Tween = game:GetService("TweenService")

--Variables
local SideBar = script.Parent:WaitForChild("SideBar")
local PlayBtn = SideBar:WaitForChild("Play")
local CreditsBtn = SideBar:WaitForChild("Credits")
local Title = SideBar:WaitForChild("Title")

Tween:Create(
	SideBar,
	TweenInfo.new(0.4,Enum.EasingStyle.Quad,Enum.EasingDirection.Out,0,false,0)
	{Position = UDim2.new(0,0,0,0)}
):Play()

also i asked this in my recent post but no one has responded lol

2 answers

✓ Accepted answer

Are you sure that's what the error is? There is an issue with this but it would be saying a different error. There is not a comma between the TweenInfo argument and the table with the tween goals, which I assume is a typo.

Tween:Create(
    SideBar,
    TweenInfo.new(0.4,Enum.EasingStyle.Quad,Enum.EasingDirection.Out,0,false,0),
    {Position = UDim2.new(0,0,0,0)}
):Play()

However, to answer your question about "attempt to call x value", it means that you tried to use something that is not a function, like a function. So to get this error with a TweenInfo object, you would do this:

TweenInfo.new(0.4,Enum.EasingStyle.Quad,Enum.EasingDirection.Out,0,false,0)() -- this looks weird but notice the two parentheses at the end, similar to how you would call a function like "myFunction()"

or

local tweenInfo = TweenInfo.new(0.4,Enum.EasingStyle.Quad,Enum.EasingDirection.Out,0,false,0),

tweenInfo()

4 comments

0

yeah i directly copied and pasted that error also, ur saying it should be TweenInfo.new,(--blah blah blah--) right? (just making sure)

0

no, it would be formatted like (target, TweenInfo.new(whatever), { goals }) 

0

hmmmmmmmmmmmmmmmmm ok i am new to scripting and scripting is hurting my brain cells lol

0

Aalso can you reply to my answer below to make sure its correct? sorry if im bothering u lol

wait so its supposed to be like this right? This is hurting my brain cells

01	wait(5)
02	 
03	--services
04	local Tween = game:GetService("TweenService")
05	 
06	--Variables
07	local SideBar = script.Parent:WaitForChild("SideBar")
08	local PlayBtn = SideBar:WaitForChild("Play")
09	local CreditsBtn = SideBar:WaitForChild("Credits")
10	local Title = SideBar:WaitForChild("Title")
11	 
12	Tween:Create(
13	    SideBar,
14	    local tweenInfo = 
        TweenInfo.new(0.4,Enum.EasingStyle.Quad,Enum.EasingDirection.Out,0,false,0),
	     tweenInfo()
15	    {Position = UDim2.new(0,0,0,0)}
16	):Play()

4 comments

0

no, I was including that as an example of what not to do as a demonstration of what will cause the "attempt to call x" error. If you want to define the TweenInfo as a variable, define it outside of the Tween:Create function, and then put the name of the variable without the () into Tween:Create. Or in your original script, add the comma right before the {table} and I think it will work

0

o ok

0

i didnt realize that the mistake was that simple..............

0

yeah, scripting can be finnicky sometimes lol

This discussion is preserved as it was. New answers, comments, and votes are closed.