i tried others with using setpartcollisiongroup but it seems its not working and i tried like using v:IsA("BasePart’) script Can i make that script like disabling player collision?
There might be another better solution, but here’s mine.
Serverscript in ServerScriptService:
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
for _, part in pairs(char:GetDescendants) do
if part:IsA("BasePart") or part:IsA("MeshPart")
part.CanCollide = false
end
end
end)
end)
im not meaning that i mean how to disable collision includes players and npcs
You can use collision groups for this. Cant
make a script right now but this might help: Collision Filtering | Roblox Creator Documentation
local db = true
local part = script.Parent
function NotHuman(hit)
local human = true
if hit.Parent :FindFirstChild("Humanoid") ~= nil then human = false end
if hit.Parent.Parent:FindFirstChild("Humanoid") ~= nil then human = false end
return human
end
part.Touched:Connect(function(hit)
if db then db = false
if NotHuman(hit) then
print("not human")
-- else print("is human")
end db = true
end
end)
Edit: Added a debounce so it doesn’t over test.
It gets tricky as a part within a part on a human can touch.
Also you’re not asking for only players. So a double test is needed …
(this is untested)
This may still give false readings and considering you’re looking for not players
you may want to go with Collision Filtering.