What does this script do?
It disables the collisions between players and vehicles, as a result players can walk through vehicles and take no damage from impact. This is the most effective way of mitigating the ability for cars to kill players.
Method
-
Navigate to the Game Panel and proceed to login.
-
Click on Game Services button and if prompted select the server you would like to disable vehicle collisions on.
-
Navigate to the File Manager.
-
From there, proceed to navigate to the
garrysmod/lua/autorun/server
directory. -
Create a file titled
disable_vehicle_collisions.lua
. -
Proceed to paste the following script in:
hook.Add("PlayerSpawnedVehicle","DisableCollisionVehicle", function(ply, ent)
if IsValid(ent) then
ent:SetCollisionGroup(COLLISION_GROUP_WEAPON)
end
end)
-
Click the Save button.
-
Navigate back to the Game Panel.
-
Restart your server.