SHARE
TWEET

Untitled

a guest Dec 3rd, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function start()
  2.     setPedCanBeKnockedOffBike(getLocalPlayer(), false)
  3.     addEventHandler("onClientPlayerVehicleEnter", getLocalPlayer(), addGravityFinder)
  4.     addEventHandler("onClientPlayerVehicleExit", getLocalPlayer(), removeGravityFinder)
  5. end
  6.  
  7. function addGravityFinder(veh)
  8.     addEventHandler("onClientRender", getRootElement(), magnetWheels)
  9.     setElementHealth(veh, 1000)
  10. end
  11.  
  12. function removeGravityFinder()
  13.     removeEventHandler("onClientRender", getRootElement(), magnetWheels)
  14. end
  15.  
  16. function magnetWheels()
  17.     local veh = getPedOccupiedVehicle(getLocalPlayer())
  18.     local x, y, z = getElementPosition(veh)
  19.     local underx, undery, underz = getPositionUnderTheElement(veh)
  20.     setVehicleGravity(veh, underx - x, undery - y, underz - z)
  21. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top