Unexpected token: match:

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Shrimped

Hello! I’m creating a game where once you hit the start button, it sends you to a level but it’s random. (Meaning, there are 10 levels, but it’s random choosing between them.) I put this case statement in my script, but there is an error that pops up.

error (24,1): Unexpected token: match:

Here is the Link to picture

Thanks!

EDIT: fixed link

I assume your code has a basic syntax issue, but you’ll probably need to post it to get any helpful input.

jgodfrey | 2020-06-24 16:13

:bust_in_silhouette: Reply From: kidscancode

Your image isn’t loading.

My guess: you tried to use match outside a function. You can only declare variables there, not execute code.