How to replace all animation ids that contain the same ids in a faster way?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to be able to change all animation ids that are using the same animationid all at once by executing a script into the command bar.
  2. What is the issue? Include screenshots / videos if possible!
    image
    Too much animations that I have too replace manually one by one…
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

No solutions found so far.

for i,Animation in pairs(game:GetDescendants()) do
	if Animation:IsA("Animation") and Animation.AnimationId == -- Old -- then
    	Animation.AnimationId = -- New --
    end
end
1 Like

I’ve tried that, and that doesn’t work.

image

Change this for each place where there are animations.
Example: workspace, StarterGui, StarterPlayerScripts, StarterCharacterScripts, etc.

image

You have to define ReplicatedStorage first.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

for i,Animation in pairs(ReplicatedStorage:GetDescendants()) do
	if Animation:IsA("Animation") and Animation.AnimationId == 4919524890 then
    	Animation.AnimationId = 6413024198
    end
end

This does work, but it still doesn’t change the id, no error or warning was shown in the output.

image
ID did not change.

Perhaps you can refer too my other post, some guy managed to solve it, so use his as an example:

local ReplicatedStorage = game:GetService("ReplicatedStorage")

for i,Animation in pairs(ReplicatedStorage:GetDescendants()) do
	if Animation:IsA("Animation") and Animation.AnimationId == "rbxassetid://4919524890" then
    	Animation.AnimationId = "rbxassetid://6413024198"
    end
end
1 Like

Thanks for helping me find a solution, that worked.

1 Like