I saw in this post that you can check where the script is located before executing it (like checking if script.Parent.Name=="StarterCharacterScripts").
But the problem is, WHY the behavior is different in these places? What is happening? Is it a bug?
Why in place A I don’t need to check the script’s parent before executing and in place B I do?
While you’re in the game, could you click “LocalScript:1” for each output? It should bring you to the script that printed each output. I’m not sure if this works as I’m away from my computer right now but it’s worth a try.
Or maybe click the text itself, again I’m not too sure which one works.
(and this time, for some reason, it shows ‘Client’ on both, before it was showing ‘Studio’ on the first and ‘Client’ on the anoter, as you can see on the previours replies.)
Edit: Just tested it, I really think this might be a bug. Sometimes it shows ‘Client’, ‘Client’, and sometimes ‘Studio’, ‘Client’.
Edit2: I just tested and this only happens in some places (in some it runs once and in others it runs twice). I still couldn’t figure out why.
i had this problem before, just dont use the Script and set RunContext to Client. Use Localscript instead because RunContext-Client is most likely the problematic one
This isn’t truly a bug. Do not put a regular script with the context on Client in script containers, as they do not follow the rules that a LocalScript does. It will execute in the container, and then a clone of it will be made over to the player or character, and then execute it twice.
Additionally, for the bug report sent above, I think someone has a misconception on which are LocalScripts and Scripts set on the context on Client, since their icons are easily confused with each other.