Garry's Mod Wiki

NPC:SetMovementActivity

NPC:SetMovementActivity( number activity )

Description

Sets the activity the NPC uses when it moves.

Arguments

1 number activity
The movement activity, see Enums/ACT.

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

Page Links


Special Pages


Wikis

?

Render Time: 28ms

DB GetPage 3
Generate Html 3
SaveChanges (1) 8
Render Body 0
Render Sidebar 12