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

Is it better to use player.CharacterAdded or put those functions in StarterCharacterScripts?

A little context, I made free roam camera which disables when the player spawns. I'm stuck on whether I should connect the disable to the player.CharacterAdded event or put it as a line of code in a script in StarterCharacterScripts.

The line of code is simply:

bindable:Fire(false)

Is there a difference between the two? Is player.CharacterAdded faster than the other?

1 answer

✓ Accepted answer

I would suggest keeping the disabling code in the same script as the rest of the free roam camera. This keeps the work generally more organised, allowing you to be able to edit and review your code more efficiently.

I assume that you are thinking of putting the .CharacterAdded into the main script, and I would suggest doing so.

This should generally be your main priority when creating scripts, as it generally streamlines workflow, and helps other also understand your code if you have someone assisting you.

Hope this helps.

2 comments

0

Thank you for the input. Both works either way, but using .CharacterAdded is less messy since it's not spread across many different scripts which is a pita (bread) to edit.

0

Glad I could be of help.

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