while true do
wait(1)
for _, group in ipairs(game:GetService("PhysicsService"):GetRegisteredCollisionGroups()) do
if group.Name ~= "default" then
game:GetService("PhysicsService"):CollisionGroupSetCollidable(groupName,group,false)
end
end
end
Also the .Name property should be lowercase when using the returned items from GetRegisteredCollisionGroups:
while true do
task.wait(1)
for _, group in game:GetService("PhysicsService"):GetRegisteredCollisionGroups() do
if group.name ~= "Default" then
game:GetService("PhysicsService"):CollisionGroupSetCollidable(groupName,group.name,false)
end
end
end
i already registered groupname, heres the full script:
local groupName = script.Parent.Plr.Value.. "ball"
local existingGroup = game:GetService("PhysicsService"):IsCollisionGroupRegistered(groupName)
if existingGroup then
script.Parent.CollisionGroup = groupName
else
game:GetService("PhysicsService"):RegisterCollisionGroup(groupName)
script.Parent.CollisionGroup = groupName
end
local playergroup = script.Parent.Plr.Value
local playerexist = game:GetService("PhysicsService"):IsCollisionGroupRegistered(playergroup)
if playerexist then
game:GetService("PhysicsService"):CollisionGroupSetCollidable(playergroup,groupName, false)
end
while true do
wait(1)
for _, group in ipairs(game:GetService("PhysicsService"):GetRegisteredCollisionGroups()) do
if group.name ~= "default" then
game:GetService("PhysicsService"):CollisionGroupSetCollidable(groupName,tostring(group),false)
end
end
end
oh yeah i did that and then it started to fall off when i added this:
while true do
wait(1)
for _, group in ipairs(game:GetService("PhysicsService"):GetRegisteredCollisionGroups()) do
if group.name ~= "default" and group.name ~= playergroup then
game:GetService("PhysicsService"):CollisionGroupSetCollidable(groupName,group.name,false)
end
end
end