Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago

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?

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

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

2 answers

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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.

1Tween:Create(
2    SideBar,
3    TweenInfo.new(0.4,Enum.EasingStyle.Quad,Enum.EasingDirection.Out,0,false,0),
4    {Position = UDim2.new(0,0,0,0)}
5):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:

1TweenInfo.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

1local tweenInfo = TweenInfo.new(0.4,Enum.EasingStyle.Quad,Enum.EasingDirection.Out,0,false,0),
2 
3tweenInfo()
0
yeah i directly copied and pasted that error also, ur saying it should be TweenInfo.new,(--blah blah blah--) right? (just making sure) TypicalVictorlks 17 — 3y
0
no, it would be formatted like (target, TweenInfo.new(whatever), { goals })  OfficerBrah 494 — 3y
0
hmmmmmmmmmmmmmmmmm ok i am new to scripting and scripting is hurting my brain cells lol TypicalVictorlks 17 — 3y
0
Aalso can you reply to my answer below to make sure its correct? sorry if im bothering u lol TypicalVictorlks 17 — 3y
Ad
Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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

0101  wait(5)
0202  
0303  --services
0404  local Tween = game:GetService("TweenService")
0505  
0606  --Variables
0707  local SideBar = script.Parent:WaitForChild("SideBar")
0808  local PlayBtn = SideBar:WaitForChild("Play")
0909  local CreditsBtn = SideBar:WaitForChild("Credits")
1010  local Title = SideBar:WaitForChild("Title")
1111  
1212  Tween:Create(
1313      SideBar,
1414      local tweenInfo =
15        TweenInfo.new(0.4,Enum.EasingStyle.Quad,Enum.EasingDirection.Out,0,false,0),
16         tweenInfo()
1715      {Position = UDim2.new(0,0,0,0)}
1816  ):Play()
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 OfficerBrah 494 — 3y
0
o ok TypicalVictorlks 17 — 3y
0
i didnt realize that the mistake was that simple.............. TypicalVictorlks 17 — 3y
0
yeah, scripting can be finnicky sometimes lol OfficerBrah 494 — 3y

Answer this question