Add speed and looping control to :animation (#1924)#2128
Open
thatgato wants to merge 5 commits into
Open
Conversation
Added optional arguments to the :animation command. New optional arguments: speed (default 1); isLooped (default false) Also updated the description of the command to be more straightforward
Contributor
Author
|
Closes issue #1924 if merged |
Forgot to put tonumber() on it Although, it was working fine without it But just to be consistent, since Functions.PlayAnimation expects a number there.
ccuser44
suggested changes
May 16, 2026
Comment on lines
+4374
to
+4377
| assert(tonumber(args[2]), `{tostring(args[2])} is not a valid ID!`) | ||
| if args[3] then | ||
| assert(tonumber(args[3]), `{tostring(args[3])} is not a valid speed!`) | ||
| end |
Contributor
There was a problem hiding this comment.
You should replace this with a more efficient piece of code.
Suggested change
| assert(tonumber(args[2]), `{tostring(args[2])} is not a valid ID!`) | |
| if args[3] then | |
| assert(tonumber(args[3]), `{tostring(args[3])} is not a valid speed!`) | |
| end | |
| local id = assert(tonumber(args[2]), `{tostring(args[2])} is not a valid ID!`) | |
| local speed = args[3] and assert(tonumber(args[3]), `{tostring(args[3])} is not a valid speed!`) or nil |
|
|
||
| for _, v in service.GetPlayers(plr, args[1]) do | ||
| Functions.PlayAnimation(v , args[2]) | ||
| Functions.PlayAnimation(v , args[2], tonumber(args[3]), isLooped) |
Contributor
There was a problem hiding this comment.
Suggested change
| Functions.PlayAnimation(v , args[2], tonumber(args[3]), isLooped) | |
| Functions.PlayAnimation(v , id, speed, isLooped) |
Comment on lines
+4378
to
+4384
|
|
||
| local isLooped = false | ||
|
|
||
| -- TODO Possibly add a helper function for parsing string into bool? | ||
| if args[4] == "true" or args[4] == "1" then | ||
| isLooped = true | ||
| end |
Contributor
There was a problem hiding this comment.
Suggested change
| local isLooped = false | |
| -- TODO Possibly add a helper function for parsing string into bool? | |
| if args[4] == "true" or args[4] == "1" then | |
| isLooped = true | |
| end | |
| local isLooped = args[4] == "true" or args[4] == "1"or false -- TODO Possibly add a helper function for parsing string into bool? |
joritochip
requested changes
May 20, 2026
Collaborator
joritochip
left a comment
There was a problem hiding this comment.
If looped arg isn't present should it should not set Looped on the animation track at all so that the animation's default looped value is used as the fallback
Contributor
Author
Made the changes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds two new optional arguments to the
:animatecommand.[speed] (default: 1): Controls the animation speed[isLooped?] (default: false): Controls whether the animation track should be loaded as a looped one, or notPoF:
2026-05-09.16-27-41.mp4
Argument validation:
speed should be a
number, otherwise the assertion will throwthe looped argument only cares about
"true"and"1"in all other cases, it will default to
false2026-05-09.16-28-28.mp4