How to remove a vehicle a player has in eyetrace when he press something?
[lua]local function RemoveOnPress( ply, key )
if key == IN_USE then
local trace = ply:GetEyeTrace()
if trace.Entity:IsValid() then
if trace.Entity:IsVehicle() then
hook.Add( “KeyPress”, “RemoveOnPress”, RemoveOnPress )[/lua]
This should work, change the key to what ever you want?