Garry's Mod Wiki

Garry's Mod Wiki

  NPC:SetMovementActivity( number activity )

Description

Sets the activity the NPC uses when it moves.

Arguments

1 number activity
The movement activity, see ACT enum.

Example

Makes all NPCs walk instead of run.

function GM:Think() for i, npc in ipairs( ents.FindByClass( "npc_*" ) ) do if IsValid( npc ) and npc:IsNPC() and npc:GetMovementActivity() ~= ACT_WALK then npc:SetMovementActivity( ACT_WALK ) end end end

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...