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

Workspace.Teleport1A.TeleportScript1A:15 help ? [closed]

Asked by 5 years ago

I am trying to solve this error.

Workspace.Teleport1A.TeleportScript1A:15: ambiguous syntax (function call x new statement) near '('
0
can you post the hole script? sydre 229 — 5y
0
Please show your script or your question will be moderated. DeceptiveCaster 3761 — 5y

Closed as Non-Descriptive by DeceptiveCaster, User#24403, and RubenKan

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 5 years ago

You did not post a script but I see your issue.

You are probably doing something like this:

(this is just an example) ```lua local num = 7/(2 + 1.5)

(function() --// ... end)() ```

Lua does not know if you are trying to call 3.5, a number value. Or if line 3 is a new statement. Since it is in parenthesis and a number literal it allows you to do this:

(3.5)()

Which causes the error of "attempt to call a number value"

What you can do is remove any parenthesis, or use a semicolon to separate it, like so:

```lua local num = 7/2 + 1.5 --// yes order of operations gets messed up, but you no longer get error

(function()

end)() ```

Or using a semicolon:

```lua

local num = 7/(2 + 1.5); --// No error and (2 + 1.5) has higher priority since in parenthesis !!!!! :DDDDD

(function()

end)() ```

Ad