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

on command walk thru players for admin what does it miss?

Asked by 4 years ago

hello so i made a walkthruplayers script but what does it miss before i can put into something like hd admin also the script is made for r6 characters

"'game:GetService("RunService").Stepped:connect(function() for _, player in pairs(game.Players:GetPlayers()) do if player ~= game.Players.LocalPlayer then local character = player.Character if character then local head = character:FindFirstChild("Head") local torso = character:FindFirstChild("Torso") if head then head.CanCollide = false end if torso then torso.CanCollide = false end end end end end)''

0
I hope that helps. kodakpro87 7 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

local PS = game:GetService("PhysicsService") PS:CreateCollisionGroup("Player") PS:CollisionGroupSetCollidable("Player","Player",false)

game.Players.PlayerAdded:Connect(function(Player) Player.CharacterAdded:Connect(function(Character) Character:WaitForChild("HumanoidRootPart") Character:WaitForChild("Head") Character:WaitForChild("Humanoid") for i,v in pairs(Character:GetChildren()) do if v:IsA("BasePart") then PS:SetPartCollisionGroup(v,"Player") end end end) end)

Ad

Answer this question