Vehicles is nocollided?

As the title.
Sometimes, the vehicles are not nocollided, and when you ram someone, they die. Sometimes, they just go through it.
Any ideas?

This is what I’ve found in my Cider init.lua :

[lua]
– Called when a player enters a vehicle.
function GM:PlayerEnteredVehicle(player, vehicle, role)
timer.Simple(FrameTime() * 0.5, function()
if ( ValidEntity(player) ) then player:SetCollisionGroup(COLLISION_GROUP_PLAYER); end;
end);
end;
[/lua]

And

[lua]
– Check if the player is an administrator.
if ( player:IsAdmin() ) then
if ( entity:IsPlayer() ) then
if ( !entity:InVehicle() ) then
entity:SetMoveType(MOVETYPE_NOCLIP);
else
return false;
end;
end;
[/lua]

Thanks in advance.

First of all, on the second peice of code you posted, there’s an end missing, whether or not you didn’t copy the end, but still. Second of all, that second peice of code is checking if the player is NOT in a vehicle, now, that would set the player to noclip permanently if they were out of a vehicle.

Do you want vehicles to collide with each other? Then you have to find the vehicle they are in, and the set the collision type to COLLISION_GROUP_VEHICLE, or, if you want them to nocollide with each other, then set the collision type to COLLISION_GROUP_DEBRIS

I don’t want them to nocollide with anything.

Take a look at **[Collision Groups

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Collision_group)**

But the one you want, is COLLISION_GROUP_VEHICLE

But you probably want something along the lines of [lua]hook.Add( “OnEntityCreated”, “VehicleCheck”, function( ent )

											if ent:IsVehicle() then
												ent:SetCollisionGroup( COLLISION_GROUP_VEHICLE )
											end
										
										end )[/lua]

Untested, but should work.