local lplayer = game.Players.LocalPlayer repeat wait() until lplayer.Character.Head local Head = lplayer.Character.Head local RS = game:GetService("RunService") local HumT = lplayer.Character.Torso local Loc = lplayer.Character RS.Stepped:connect(function() Head.CanCollide = false HumT.CanCollide = false end) Loc.Changed:connect(function(Property) if Property == "CanCollide" then Head.CanCollide = false HumT.CanCollide = false end end)
It changes Head / Torso from Player2 but not to Player1 when you do the Server Simulation with 2 players. And this is supposed to overwrite to each local player, can't understand why it's doing that...
Not sure if it'll work in online mode, but it works in studio so far
I made it wait until the head is found, usually WaitForChild
is a good way to get stuff inside the character.
local lplayer = game.Players.LocalPlayer repeat wait() until lplayer.Character:WaitForChild('Head') local Head = lplayer.Character.Head local RS = game:GetService("RunService") local HumT = lplayer.Character.Torso local Loc = lplayer.Character RS.Stepped:connect(function() Head.CanCollide = false HumT.CanCollide = false end) Loc.Changed:connect(function(Property) if Property == "CanCollide" then Head.CanCollide = false HumT.CanCollide = false end end)
It should've work now but it doesn't, I've did a table with the parts, and it still doesn't cancollide to every player in the Simulated Server.
local lplayer = game.Players.LocalPlayer repeat wait() until lplayer.Character.Head local Head = lplayer.Character.Head local RS = game:GetService("RunService") local HumT = lplayer.Character.Torso local Loc = {lplayer.Character.Torso, lplayer.Character.Head, lplayer.Character.HumanoidRootPart} RS.Stepped:connect(function() Head.CanCollide = false HumT.CanCollide = false end) lplayer.Changed:connect(function(Property) if Property == "CanCollide" then for i,v in pairs(Loc) do v.CanCollide = false end end end)
I have no output errors.