fireWeapon | Multi Theft Auto: Wiki Skip to content

fireWeapon

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


Fires one shot from a custom weapon.

Syntax

fireWeapon ( )

Code Examples

client

This function creates and fires a weapon.

function createAndFire()
local weaponElement = createWeapon("mp5", 0, 0, 3) -- Create a MP5 at the coordinates 0, 0, 3
fireWeapon(weaponElement) -- Fire the weapon we spawned
end
addEventHandler("onClientResourceStart", resourceRoot, createAndFire)

See Also