Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

What are some ways to use pcall instead of datatsores?

Asked by 5 years ago
Edited 5 years ago

What if i wanted to use pcall for something like to check if a object is in a position or not or something else more creative thats object oriented

1 answer

Log in to vote
0
Answered by
vissequ 105
5 years ago
Edited 5 years ago

I mostly use what I call "lazy pcalls" so if I have some code which is erroring BUT the code is still running the way I want OR if certain code errors SOMETIMES and breaks the rest of the script but works other times, then I will wrap the offending code in a pcall.

As far as checking if things exist, it would be better, I think to use something like FindFirstChild.

For checking positions I would do an if statement.

Ad

Answer this question