LunaLua:1: '=' expected near "onTick"

Post here for help and support regarding LunaLua and SMBX2's libraries and features.
Someone
Koopa
Koopa
Posts: 17
Joined: Tue Dec 15, 2020 8:40 am

LunaLua:1: '=' expected near "onTick"

Postby Someone » Wed Jun 08, 2022 9:49 am

Tried following Enjl youtube tutorial. And error keeps popping up. Can someone help?

Code: Select all

Function onTick()
	if player.keys.up == KEYS_PRESSED then
		Misc.dialog("test1")
	elseif player.keys.up == KEYS_UNPRESSED then
		Misc.dialog("test2")
end
end

Radiance
Boomerang Bro
Boomerang Bro
Posts: 1335
Joined: Thu Dec 10, 2015 7:53 am
Pronouns: he/him

Re: LunaLua:1: '=' expected near "onTick"

Postby Radiance » Wed Jun 08, 2022 11:19 am

"Function" should be decapitalized so it's "function" instead.

deice
Volcano Lotus
Volcano Lotus
Posts: 549
Joined: Fri Jul 23, 2021 7:35 am

Re: LunaLua:1: '=' expected near "onTick"

Postby deice » Wed Jun 08, 2022 11:21 am

also, there is an extra "end" keyword at the bottom that is superfluous.

Radiance
Boomerang Bro
Boomerang Bro
Posts: 1335
Joined: Thu Dec 10, 2015 7:53 am
Pronouns: he/him

Re: LunaLua:1: '=' expected near "onTick"

Postby Radiance » Wed Jun 08, 2022 11:24 am

deice wrote:
Wed Jun 08, 2022 11:21 am
also, there is an extra "end" keyword at the bottom that is superfluous.
The first end is just unindented so it's fine I think

deice
Volcano Lotus
Volcano Lotus
Posts: 549
Joined: Fri Jul 23, 2021 7:35 am

Re: LunaLua:1: '=' expected near "onTick"

Postby deice » Wed Jun 08, 2022 11:26 am

Drifloon wrote:
Wed Jun 08, 2022 11:24 am
The first end is just unindented so it's fine I think
ah yea my bad, i didn't actually notice that the if statement wasn't closed above that. the only error is the wrong capitalization of "function".

Someone
Koopa
Koopa
Posts: 17
Joined: Tue Dec 15, 2020 8:40 am

Re: LunaLua:1: '=' expected near "onTick" (Solved)

Postby Someone » Wed Jun 08, 2022 1:12 pm

Thanks for help!

Added in 7 minutes 26 seconds:
Re: LunaLua:1: '=' expected near "onTick" (Not Solved)
Someone wrote:
Wed Jun 08, 2022 1:12 pm
Thanks for help!
...Uh...
Image

deice
Volcano Lotus
Volcano Lotus
Posts: 549
Joined: Fri Jul 23, 2021 7:35 am

Re: LunaLua:1: '=' expected near "onTick" (Solved)

Postby deice » Wed Jun 08, 2022 1:33 pm

Someone wrote:
Wed Jun 08, 2022 1:20 pm
...Uh...
i corrected myself in the thread, the second end wasn't unnecessary (i didn't read the code correctly). also, you shouldn't put a semicolon after the function name.


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 3 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari