Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Any alternatives to Functions?

Most of my script's errors are caused by needing an end at the end of the code due to a function in the script. Is there any alternatives to functions so I don't need to put ends?

2 comments

0

ROBLOX usually adds ends for you if needed, but you should be able to know to check just in-case. Anyway, no. ends are the only way ROBLOX knows to stop something.

0

If you tabbed your code properly, this would never be an issue.

1 answer

Not really... No. Ends are needed to close a function, loop, or if then statement.

They are not avoidable. I would recommend however, if you start a function, to place a end right after it. If the settings are at factory default in ROBLOX studio, it should automatically end a function for you when you hit enter.

If you're having problems with your scripts not having enough ends then you're probably going wrong somewhere, and should try rewriting your script.

Sorry if this answer didn't help but I do not believe ends are avoidable.

This discussion is preserved as it was. New answers, comments, and votes are closed.