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

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

Asked by 3 years ago

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

Log in to vote
1
Answered by 3 years ago

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.

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. radiant_Light203 1166 — 3y
0
Glad I could be of help. NinjaMandalorian 252 — 3y
Ad

Answer this question