Script Error on Animation Script

  1. What do you want to achieve? I want to achieve making a game like Airplane using Ponchoking’s tutorial.
  2. What is the issue? My script is showing an error.
  3. What solutions have you tried so far? I have tried none, I don’t want to waste much time on looking for the solution.

Script:

local animIdle = Instance.new("Animation")

animIdle.AnimationId = ""

local controller = script.Parent.Humanoid

controller:LoadAnimation(animIdle):Play[]

The problem is this:

[]

The first [ is showing an error. If you need a screenshot, ask me.

The ID isn’t ready yet. 30chars

When you call a function or method you need to use parentheses (), not brackets. When you have an empty set of parentheses after a function, it means you are calling the function without any arguments.

Generally in Lua, parentheses are for surrounding logic and math expressions and arguments of function calls, curly brackets are for defining tables, and square brackets are for indexing values inside of tables.

1 Like

The script error is now gone, thank you so much!