Functional Programming scripting

i’m new with functional programming and OOP but i was doing my tests and ended up trying to use this method with pcall funtions this is the result:

should i still use it like that? or is it a bad habit? if so is there any way to improve it?

1 Like

I did that once and oh boy, debugging was a mess.

You should write the function without pcalls first, then after you’re certain that it works and want for the function to always continue, encase the already-working functions in a pcall.

1 Like

i’m gonna look into that! any suggestions on how this could be handled at it’s best?

Functional programming is best handled if a specific line(s) of code is reused more often. It helps the scalability of your code, readability, debuggability, and good use of storage.

pcalls are always best at player-to-server and server-to-player interactions, since errors can occur more frequently in these interactions. You can always encase a pcall in a for i loop so it retries for a set amount of times until success and break the loop. Some examples of pcalls are character model handling and player statistics.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.