-stolka- Posted October 19, 2013 Share Posted October 19, 2013 why does it bind the key for everyone and not just who entered the vehicle? addEventHandler("onClientVehicleEnter", root, function(thePlayer, seat) local theVehicle = source if getElementModel(theVehicle) == 487 then local x, y, z = getElementPosition ( theVehicle ) local rx, ry, rz = getElementRotation ( theVehicle ) minigunOne = createWeapon ( "minigun", x, y, z ) minigunTwo = createWeapon ("minigun", x, y, z ) minigunOneF = createWeapon ( "minigun", x, y, z ) minigunTwoF = createWeapon ("minigun", x, y, z ) setElementAlpha ( minigunOne,0) setElementAlpha ( minigunTwo,0) attachElements ( minigunOne, theVehicle, 1.15, 2, -1.3, 0, 0, 93) attachElements ( minigunTwo, theVehicle, -1.15, 2, -1.3, 0, 0, 93 ) attachElements ( minigunOneF, theVehicle, 1.15, 2, -0.62, 0, 30, 93) attachElements ( minigunTwoF, theVehicle, -1.15, 2, -0.62, 0, 30, 93 ) bindKey ( "mouse1", "down", enableFire ) bindKey ( "mouse1", "up", disableFire ) end end ) Link to comment
Guest Guest4401 Posted October 19, 2013 Share Posted October 19, 2013 addEventHandler("onClientVehicleEnter", root, function(thePlayer, seat) local theVehicle = source if getElementModel(theVehicle) == 487 then local x, y, z = getElementPosition ( theVehicle ) local rx, ry, rz = getElementRotation ( theVehicle ) minigunOne = createWeapon ( "minigun", x, y, z ) minigunTwo = createWeapon ("minigun", x, y, z ) minigunOneF = createWeapon ( "minigun", x, y, z ) minigunTwoF = createWeapon ("minigun", x, y, z ) setElementAlpha ( minigunOne,0) setElementAlpha ( minigunTwo,0) attachElements ( minigunOne, theVehicle, 1.15, 2, -1.3, 0, 0, 93) attachElements ( minigunTwo, theVehicle, -1.15, 2, -1.3, 0, 0, 93 ) attachElements ( minigunOneF, theVehicle, 1.15, 2, -0.62, 0, 30, 93) attachElements ( minigunTwoF, theVehicle, -1.15, 2, -0.62, 0, 30, 93 ) if thePlayer == localPlayer then bindKey ( "mouse1", "down", enableFire ) bindKey ( "mouse1", "up", disableFire ) end end end ) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now