• disable player collision?
    4 replies, posted
Is there a script/addon that is able to disable player collisions in sandbox so people can't constantly bodyblock eachother? And I'm talking about player/player collisions and not collisions with props. thanks!
Entity/SetCollisionGroup https://wiki.garrysmod.com/page/Enums/COLLISION_GROUP hint: playerspawn hook
GM/ShouldCollide is the event you want to hook into using their example hook.Add("PlayerInitialSpawn","nocollided players",function(ply)--ply is the player who finished joining the server and has had their entity created timer.Simple(0.1,function()--players can be invalid during the instant that they spawned for the first time if ply:IsValid() then--is the player's entity valid? ply:SetCustomCollisionCheck(true)--mark the player for collision checks end end) end) hook.Add("ShouldCollide","nocollided players",function(ent1,ent2) if ent1 and ent2 and ent1:IsValid() and ent2:IsValid() and ent1:IsPlayer() and ent2:IsPlayer() then-- are both entities player entities? return false-- returning false on this hook prevents collisions between these 2 entities end end
can I just use this script for the server? this applies to any player on the server right or do I have to add more entities to the list?
Instead of just copypasting, learn what the script does and try to do it on your own.
Sorry, you need to Log In to post a reply to this thread.