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

How do I make a script than can enable and disable player - player collision?

Asked by 5 years ago
Edited 5 years ago

It is not working for me

p = game.Players.LocalPlayer.Character:GetChildren()
game.Players.LocalPlayer.Character:GetChildren() do
    p.CanCollide = true
end
0
That'd imply using CollisionGroups, and since the following link isn't practically deserving to be an answer (I didn't make it) i'm posting it here. https://pastebin.com/fFdFJr1D SulaymanArafat 230 — 5y
0
I did something similar to this recently and found this article useful: http://robloxdev.com/articles/Player-Player-Collisions. It covers assigning all players to a " player" collision group and then sets that "player" collision group to not collide with itself using https://wiki.roblox.com/index.php?title=API:Class/PhysicsService/CollisionGroupSetCollidable. Lyttlefreak 8 — 5y

1 answer

Log in to vote
0
Answered by
Oficcer_F 207 Moderation Voter
5 years ago

It is only the torso that collides, try this:

player = game.Players.LocalPlayer

while true do —whatever loop you want

player.Character.Torso.CanCollide = false
wait(1)
player.Character.Torso.CanCollide = true
wait(1)

end

Basically change the canCollide property of Torso. You dont need to chabge the other stuff

Ad

Answer this question