Gamemode.PlayerSpawnEffect

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NamePlayerSpawnEffect
SyntaxGM:PlayerSpawnEffect( Player ply, String mdl )
DescriptionCalled when a player spawns an effect
ReturnsBoolean - false to prevent spawning of the effect
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.PlayerSpawnEffect]Gamemode.PlayerSpawnEffect [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionBlocks the spawning of effects in the models table.
Used onNewerServer.png
Code
local models = { "models/Effects/splode.mdl" } --All or part of model name.
local function blockEffects( ply, mdl )
	for _, v in pairs( models ) do
		if string.find( mdl, v ) then
			return false
		end
	end
end
hook.Add( "PlayerSpawnEffect", "blockEffects", blockEffects )
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox