Gamemode.GravGunOnDropped

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NameGravGunOnDropped
SyntaxGM:GravGunOnDropped( Player player, Entity target )
DescriptionCalled when the gravity gun releases an object, either dropping or launching it.
ReturnsNil
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.GravGunOnDropped]Gamemode.GravGunOnDropped [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionSets an object on fire when the player launches it.
Used onNewerServer.png
Code
function gravDrop(ply,ent)
	if ply:KeyDown(IN_ATTACK) then
		-- it was launched
		ent:Ignite(20,40)
	else
		-- it was dropped
	end
end
 
hook.Add( "GravGunOnDropped", "firyLaunch", gravDrop)
OutputN/A


Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox