Jump to content

[HELP]Need Shooter script for a specific vehicle (only)


Speedo

Recommended Posts

Hi all,

i've looker around ,in community and the forum itself and cant find anything like this.

Well i found the script to shoot from the car, but this apply to all cars in the map, i need one script that apply the rocket to only 1 car or 2.

Here the script i want to modify:

local shootingAllowed = true 
  
function playerSpawn() 
 shootingAllowed = true 
end 
addEventHandler("onClientPlayerSpawn", getLocalPlayer(), playerSpawn) 
  
function doShoot() 
 if shootingAllowed == true then 
  if not isPlayerDead(getLocalPlayer()) then 
   shootingAllowed = false 
   local theVehicle = getPedOccupiedVehicle(getLocalPlayer()) 
   local x,y,z = getElementPosition(theVehicle) 
   local rX,rY,rZ = getVehicleRotation(theVehicle) 
   local x = x+4*math.cos(math.rad(rZ+90)) 
   local y = y+4*math.sin(math.rad(rZ+90)) 
   createProjectile(theVehicle, 19, x, y, z, 1.0, nil) 
   setTimer(allowShooting, 3000, 1) 
  end 
 end 
end 
  
function allowShooting() 
 shootingAllowed = true 
end 
  
for keyName, state in pairs(getBoundKeys("fire")) do 
 bindKey(keyName, "down", doShoot) 
end 

Edited by Guest
Link to comment

Look 1st post

here, i found 2 .lua file saved on my documents (i downloaded them not made by me).. i will post it here to see if this one is correct, i will test it on a map if you need

--

Edit

Edited by Guest
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...