Skip to content

Commit 49f07bf

Browse files
authored
Merge pull request #22 from Vurv78/resetsequence
Add `Entity:ResetSequence` overload
2 parents 6faadb6 + 0974c74 commit 49f07bf

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

custom/Entity.ResetSequence.lua

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---[SHARED] Plays an animation on the entity. This may not always work on engine entities.
2+
---
3+
--- This will not reset the animation on viewmodels, use Entity:SendViewModelMatchingSequence instead.
4+
---
5+
--- This will not work properly if called directly after calling Entity:SetModel. Consider waiting until the next Tick.
6+
---
7+
--- Will not work on players due to the animations being reset every frame by the base gamemode animation system. See GM:CalcMainActivity.
8+
---
9+
--- For custom scripted entities you will want to apply example from ENTITY:Think to make animations work.
10+
---
11+
---[(View on wiki)](https://wiki.facepunch.com/gmod/Entity:ResetSequence)
12+
---@param sequence number The sequence to play. Also accepts strings.
13+
---
14+
--- If set to a string, the function will automatically call Entity:LookupSequence to retrieve the sequence ID as a number.
15+
function Entity:ResetSequence(sequence) end
16+
17+
---[SHARED] Plays an animation on the entity. This may not always work on engine entities.
18+
---
19+
--- This will not reset the animation on viewmodels, use Entity:SendViewModelMatchingSequence instead.
20+
---
21+
--- This will not work properly if called directly after calling Entity:SetModel. Consider waiting until the next Tick.
22+
---
23+
--- Will not work on players due to the animations being reset every frame by the base gamemode animation system. See GM:CalcMainActivity.
24+
---
25+
--- For custom scripted entities you will want to apply example from ENTITY:Think to make animations work.
26+
---
27+
---[(View on wiki)](https://wiki.facepunch.com/gmod/Entity:ResetSequence)
28+
---@param sequence string The sequence to play. Also accepts strings.
29+
---
30+
--- If set to a string, the function will automatically call Entity:LookupSequence to retrieve the sequence ID as a number.
31+
function Entity:ResetSequence(sequence) end

0 commit comments

Comments
 (0)