Skip to content

Instantly share code, notes, and snippets.

@CapsAdmin
Created April 23, 2014 17:05
Show Gist options
  • Select an option

  • Save CapsAdmin/11223748 to your computer and use it in GitHub Desktop.

Select an option

Save CapsAdmin/11223748 to your computer and use it in GitHub Desktop.
--hook.Add("Think",1,function() ??
for k,v in pairs(player.GetAll()) do
local ent = v:GetEyeTrace().Entity
if v:KeyDown(IN_USE and ent:IsVehicle() then
if v.mycar ~= ent then
pirnt("hm")
v.mycar = ent
v.mycartime = CurTime()
elseif v.mycar == ent and v.mycartime + 2 >= CurTime() then
v.mycar:GetDriver():ExitVehicle()
timer.Simple(0, function()
v:EnterVehicle(v.mycar)
v.mycar = NULL
v.mycartime = 0
end, v)
end
else
v.mycar = NULL
v.mycartime = 0
end
end
--end) ??
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment