I created a local script inside of Starter Pack to make all players CanCollide false. When I test with 2 people with the test option in studio, it works the first second then stops. I get no error. Here is the code:
local player = game.Players.LocalPlayer local character = player.Character wait(.1) game:GetService('RunService').Stepped:connect(function() local parts = character:GetChildren() if parts.ClassName == "Part" and parts.ClassName == "Hat" then parts.CanCollide = false end end)
The GetChildren()
method returns a table of everything inside of whatever you called the function for.
ScriptGuider explains tables very well. Here's a link to his answer.
For your question, we don't even need to use tables really. Besides looping through one. We're going to use a Pairs Loop
. A pairs loop will let us loop through everything inside of a table and give us the value in the table each loop.
local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:wait() wait(.1) game:GetService('RunService').Stepped:connect(function() local parts = character:GetChildren() for i,v in pairs(parts) do if v:IsA("Part") then v.CanCollide = false end end end)
I also waited for the character to load, and checked if what was inside the character was a part.
I'm not sure this is going to make the character a ghost, but this is a fix to your problem.
Good Luck!