I want to disable the collision of the players while the player it is in the menu(Because I made a customize system and I don’t want the players colliding with eacher other), but locally . When he click the play button the collision turn off and he just started to play. (I already made a topic of this, but I didn’t get straight answers)
CollisionGroupId should do the job
1 Like
You can also just parent all other characters to a random folder that’s not in workspace and the LocalPlayer won’t collide with them.
Read this article it should be what you want
How am I supposed to do it locally? I already tried CollisionGroupId and it only works in scripts
On a local script, you can use this:
--//Services
local Players = game:GetService("Players")
--//Variables
local LocalPlayer = Players.LocalPlayer
local CharacterFolder = Instance.new("Folder")
--//Tables
local Connections = {}
--//Functions
local function RemoveAllPlayers()
for i, player in ipairs(Players:GetPlayers()) do
task.spawn(function()
if player == LocalPlayer then
return
end
Connections[player] = player.CharacterAdded:Connect(function(character)
character.Parent = CharacterFolder
end)
if player.Character then
player.Character.Parent = CharacterFolder
end
end)
end
Connections.PlayerAdded = Players.PlayerAdded:Connect(function(player)
Connections[player] = player.CharacterAdded:Connect(function(character)
character.Parent = CharacterFolder
end)
end)
end
local function AddAllPlayers()
for i, connection in pairs(Connections) do
connection:Disconnect()
Connections[i] = nil
end
for i, character in ipairs(CharacterFolder:GetChildren()) do
character.Parent = workspace
end
end
RemoveAllPlayers()
--//Waits 3 seconds, and then adds all players back
task.wait(3)
AddAllPlayers()
1 Like
Thanks man! This helped me a lot
No problem. If you have any more questions, feel free to ask.