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

Why does it say "attempt to call a nil value" when I do this? [closed]

Asked by 5 years ago

Hello guys, I have a sad story. I have been working on this for several hours and I cannot seem to find a solution that works. This piece of code doesn't work:

(function () print'josh =' end)()(function () print'noob' end)()

Ignore what the body is in those functions, it doesn't matter because I still get the same error, which is:

[string "(function () print'josh =' end)()(function ..."]:1: attempt to call a nil value

Does anybody know how to fix this? It would really mean the world to me, and many others who share this issue too! Please help...

Locked by User#24403

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
2
Answered by 5 years ago

I have no idea why you would ever want to do this but it seems to be something to do with how lua is parsing the code. To resolve this include ; to specify the end of statment.

Example

(function () print'josh =' end)();(function () print'noob' end)()

hope this helps.

0
THANK YOU SO MUCH THANK YOU I LOVE YOU 1TheNoobestNoob 717 — 5y
Ad