I am having an issue with Scripts, that have a RunContext set to client, inside the StarterCharacterScripts
Before I go and post this as a bug, I thought I would see if maybe I just don’t understand why this is happening, or if its happening to anyone else.
The issue
If I have 2 scripts in StarterCharacterScripts
one is a Script with RunContext as Client
the other is just a normal LocalScript
both scripts have the same code…
print(script.Name..".Parent = "..script.Parent)
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
print(script.Name.." Found Humanoid")
So from that I see that both scripts, printed out the correct Parent, and they both found the Humanoid in their parent (the Character)
However, then it throws an error, acting as if somehow a clone of the ‘Script’ is trying to run inside StarterCharacterScripts, without placing it inside a ‘Character’
The Script is essentially running in both the Character, and inside StarterCharacterScripts which is why its both working and not working.
I dont think its normal though, I think its a Bug, and should Probably be Reported as such.
Edit: I found why,
How does RunContext interact with ‘Starter’ containers?
Starter containers work by cloning their contents locally therefore they will make a copy of any scripts contained in them. If you are using one of the new RunContexts such as Client or Server then both the original scripts and their copies will run. Therefore, you should continue to use the Legacy RunContext or LocalScripts in these containers.