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 _, npc in pairs(ents.FindByClass("npc_*")) do if(IsValid(npc) && npc:IsNPC() && npc:GetMovementActivity() != ACT_WALK) then npc:SetMovementActivity(ACT_WALK) end end end

Page Links


Special Pages


Wikis

?

Render Time: 30ms

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