Entity.FireBullets

From GMod Wiki

Revision as of 19:06, 12 August 2010 by Kilburn (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax Entity:FireBullets( Table :Bullet bulletstruct )
Description:
Fires bullets from the entity.
Returns: nil
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.FireBullets]Entity.FireBullets [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionThis will fire a bullet from a barrel.
Used onNewerServer.png
Code
barrel=ents.create("prop_physics")
barrel:SetModel("models/props_c17/oildrum001.mdl")
barrel:SetPos(Vector(0,0,0))
barrel:Spawn()
 
bullet = {}
bullet.Num=1
bullet.Src=barrel:GetPos()
bullet.Dir=barrel:GetAngles():Forward()
bullet.Spread=Vector(0.01,0.01,0)
bullet.Tracer=1	
bullet.Force=2
bullet.Damage=1
 
barrel:FireBullets(bullet)
OutputA bullet is fired from the barrel created.


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox