I'm not sure if it's a bug or I made mistakes.

Does the issue occur in the editor or during gameplay?

  • Editor

If it's a gameplay issue, please specify which movement system and camera type you're using (free movement vs. grid movement, third-person vs. first-person) or N/A if not applicable:

  • N/A

Briefly describe the issue you're experiencing:

Put any command after if/then/end, I get unexpected token.

But if put if/then/end at the end of the code, no error but the result gets silly.

Are there any errors in the in-game debug console or external console window?

  • No
    Linko changed the title to Commands ignored after if/then/end .

    Linko your end needs to have a semicolon (end;)which is why your first script does not compile.
    Its not the play_group function thats erroring, its the end above.