Advertisement
Guest User

Untitled

a guest
May 27th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.60 KB | None | 0 0
  1. local seatpos = Vector(0,0,0)
  2. local nextt = CurTime()
  3.  
  4. local function Vehicles_DevThink()
  5.     if(DEVMODE && DEV_SEATPOS && nextt < CurTime()) then
  6.         local mul = 1
  7.        
  8.         if(player.GetByID(1):KeyDown(IN_SPEED)) then
  9.             mul = 3
  10.         elseif(player.GetByID(1):KeyDown(IN_DUCK) || player.GetByID(1):KeyDown(IN_WALK)) then
  11.             mul = .5
  12.         end
  13.        
  14.         if(player.GetByID(1):KeyDown(IN_FORWARD)) then
  15.             print("Moving forward")
  16.             seatpos.y = seatpos.y + 1 * mul
  17.             GAMEMODE.CARSEAT:SetPos(GAMEMODE.CAR:LocalToWorld(seatpos))
  18.         elseif(player.GetByID(1):KeyDown(IN_BACK)) then
  19.             print("Moving back")
  20.             seatpos.y = seatpos.y - 1 * mul
  21.             GAMEMODE.CARSEAT:SetPos(GAMEMODE.CAR:LocalToWorld(seatpos))
  22.         elseif(player.GetByID(1):KeyDown(IN_MOVELEFT)) then
  23.             print("Moving left")
  24.             seatpos.x = seatpos.x + 1 * mul
  25.             GAMEMODE.CARSEAT:SetPos(GAMEMODE.CAR:LocalToWorld(seatpos))
  26.         elseif(player.GetByID(1):KeyDown(IN_MOVERIGHT)) then
  27.             print"Moving right"
  28.             seatpos.x = seatpos.x - 1 * mul
  29.             GAMEMODE.CARSEAT:SetPos(GAMEMODE.CAR:LocalToWorld(seatpos))
  30.         elseif(player.GetByID(1):KeyDown(IN_JUMP)) then
  31.             print("Moving up")
  32.             seatpos.z = seatpos.z + 1 * mul
  33.             GAMEMODE.CARSEAT:SetPos(GAMEMODE.CAR:LocalToWorld(seatpos))
  34.         elseif(player.GetByID(1):KeyDown(IN_ALT2)) then
  35.             print("Moving down")
  36.             seatpos.z = seatpos.z - 1 * mul
  37.             GAMEMODE.CARSEAT:SetPos(GAMEMODE.CAR:LocalToWorld(seatpos))
  38.         elseif(player.GetByID(1):KeyDown(IN_ATTACK)) then
  39.             print(seatpos)
  40.             DEV_SEATPOS = false
  41.             seatpos = Vector(0,0,0)
  42.         end
  43.         nextt = CurTime() + .2
  44.     end
  45. end
  46. hook.Add("Think", "VehicleMod_DevThink", Vehicles_DevThink)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement