Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:1.00

Description

Description:

Creates a shot of the specified type.

Note: Versions older than V1.54 require the -tws command-line option, in order to use this command.

Syntax

Syntax:createShot [ammotype, position, velocity, sound, tracer, target]
Parameters:
  • ammotype: String - Class name of ammunition (see the ammo parameter in Magazine Parameters in the VBS Developer Reference) to create.
  • position: Position3D - Position at which the shot is created.
  • velocity: Vector3D - Velocity [x, y ,z] at which the ammunition travels.
  • sound: String - Class name of weapon (see Weapon Configuration in the VBS Developer Reference), whose sound to play when the shot is created (optional, default: "") (V1.61+).
  • tracer: Boolean - If true, then a tracer shot is created (V2.00+).
  • target: Object - Target object. If the projectile is guided, it tracks this target (optional, default: objNull) (V18.2.0+).
Return Value:Object - Shot created.

Examples

Examples:
Create RPG grenade:
createShot ["R_PG7V_AT",player modelToWorld [0,50,2],[0,-50,0]]
Create pistol shot with cannon sound:
createShot ["vbs2_ammo_b_9x19_ball",_pos1,[0,10,0],"vbs2_2a18_122mm"]

Additional Information

See also:
Multiplayer:
Problems:

Notes