So thats my code and the error is in the title but I don’t know how to fix it
local PhysicService = game:GetService("PhysicsService")
local PlayersGroup = "Players"
PhysicService:CollisionGroupSetCollidable(PlayersGroup, PlayersGroup, false)
local function TurnOffCharacterCollisions(character)
local allChildren = character:GetDescendants()
for i = 1, #allChildren do
local limb = allChildren[i]
if limb:IsA("BasePart") then
limb.CollisionGroup = "Players"
end
end
end
for i,v in ipairs(workspace.Dummys:GetChildren()) do
TurnOffCharacterCollisions(v)
end
workspace.Dummys.ChildAdded:Connect(function(Player)
TurnOffCharacterCollisions(Player)
end)
local function character_added(character)
character.AncestryChanged:wait()
game:GetService("RunService").Stepped:wait()
character.Parent = game.Workspace.Dummys
end
game:GetService("Players").PlayerAdded:Connect(function(player)
local character = player.Character or player.CharacterAdded:Wait()
player.CharacterAdded:Connect(character_added)(character) --error
end)