Entity.AddEffects

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:AddEffects( Enum effect )
Description:
Gives an entity the given engine-based effect(s).
Returns: nil
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.AddEffects]Entity.AddEffects [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionAdds a blinking effect to an entity.
Used onNewerShared.png
Code
 
Entity:AddEffects( EF_ITEM_BLINK );
 
OutputN/A


DescriptionAdds a blinking effect and a bright light effect.
Used onNewerShared.png
Code
 
Entity:AddEffects( EF_ITEM_BLINK | EF_BRIGHTLIGHT );
 
OutputN/A


DescriptionMakes a human ragdoll act like the zombie NPC
Used onNewerShared.png
Code
 
if SERVER then
	local npc = ents.Create("npc_zombie")
	npc:SetPos(vector_origin)
	npc:Spawn()
else
	local zombie = ents.FindByClass("npc_zombie")[1] 
	zombie.mdl = ClientsideModel("models/Kleiner.mdl")
	zombie.mdl:SetParent(zombie)
	zombie.mdl:AddEffects(EF_BONEMERGE)
	zombie:SetColor(0, 0, 0, 0) 
end
 
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox