Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there a way to stop all Animations?

Asked by
Oaktin 35
9 years ago

I want to stop all the animations that are happening on the Local Player. Is there a way I can do this using tables or what?

All feedback is great. Thanks.

0
theoretically it is possible, but are the animations in the player, character, or both? koolkid8099 705 — 9y
0
They are in a screen GUI in the player. Oaktin 35 — 9y
0
can you tell me the exact tree to get there. For example: player.PlayerGui.Blah.Blah.Blah koolkid8099 705 — 9y
0
Well the animations are located in (script.Animations.ANIMHipHop) and I located the humanoid using (game.Players.LocalPlayer.Character.Humanoid) Oaktin 35 — 9y
0
iam give a broad answer koolkid8099 705 — 9y

2 answers

Log in to vote
0
Answered by 9 years ago

im not 100% sure if this would necessarily "stop" the animation. But it would destroy it so therefor it would be nothing else to play >.>

local player = game.Players.LocalPlayer
for i,v in pairs(player.PlayerGui.ScreenGui.Script:GetChildren())do
    if v:IsA("Animation") then
    v:Destroy()
    end
end
Ad
Log in to vote
0
Answered by 9 years ago

If you want to temporarily disable them, the simplest way to do so is storing their AnimationId and changing it to an empty string to disable them.

local animation_id = Animation.AnimationId
Animation.AnimationId = "" --disabled
--later
Animation.AnimationId = animation_id --enabled

For multiple animations, I suggest looping through them and storing their AnimationIds in a table.

Answer this question