Search code examples
luarobloxtween

Attempt to call a table value when tweening in Roblox


I am remaking a game of mine, but I keep running into an error when trying to tween an instance;

Workspace.core.Script:4: attempt to call a table value

Although TweenService requires a table to work.

Here is my code:

temp = workspace.values.core.temp
tw = game:GetService("TweenService")
while true do
    g = tw:Create(script.Parent,TweenInfo(10-(temp.Value/200),Enum.EasingStyle.Circular,Enum.EasingDirection.InOut),{Size = Vector3.new(5,5,5)})
    g:Play()
    g.Completed:Wait()
end

I have tried setting script.Parent.Size as the Instance and the Vector3 in the goal, which didn´t work, everything I have tried returned the error above.


Solution

  • To use constructors in roblox, you have to do Class.new(). So for TweenInfo it has to be TweenInfo.new()