R6 Animate Not Applying New IDs

I’m wanting to edit the default R6 “Animate” script that every player has when they load in.

  • I’ve already taken the original script from the character and put it into the “StarterCharacterScripts”
  • Wanting to make the script compatible with a module script in “ReplicatedStorage”

Animate Script

-- humanoidAnimatePlayEmote.lua

local replicated = game:GetService("ReplicatedStorage")
local magicLib = require(replicated:WaitForChild("MagicLibrary"))

local player = game.Players.LocalPlayer
local playerMagic = player:WaitForChild("Magic")

local magicData = magicLib[playerMagic.Value]
local playerAnims = magicData.Movement

--Original Script

local animNames = { 
	idle = 	{	
				{ id = playerAnims.Idle, weight = 9 },
				{ id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
			},
	walk = 	{ 	
				{ id = playerAnims.Walk, weight = 10 } 
			}, 
	run = 	{
				{ id = playerAnims.Run, weight = 10 } 
			}, 
	jump = 	{
				{ id = playerAnims.Jump, weight = 10 } 
			}, 
	fall = 	{
				{ id = playerAnims.Fall, weight = 10 } 
			}, 
	climb = {
				{ id = "http://www.roblox.com/asset/?id=180436334", weight = 10 } 
			}, 
	sit = -- Original Script

Module Script

local MagicLib = {

	["Fire Magic"] = {
		Name = "Fire Magic";
		Description = nil;

		Movement = {
			Idle = 80511069809894,
			Walk = 116156611636303,
			Run  = 71475010221682,
			Jump = 89563462347179,
			Fall = 108018389118675,
		},
	},
} return MagicLib

I’ve already tried to change the Idle, Walk, Run, etc. from the module script to be formatted “http://www.roblox.com/asset/?id=___” and “rbxassetid://___”, but they did not work.

Explorer Layout

Any help is greatly appreciated.

I replaced the other scripts for this one.

Place this script in ServerScriptService
local players = game:GetService("Players")

players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local hum = character:FindFirstChild("Humanoid")

		local animScript = character:FindFirstChild("Animate")
		if hum and hum:IsA("Humanoid") and animScript and animScript:IsA("Script") then
			game:GetService('RunService').PreSimulation:Wait()
			local animator = hum:FindFirstChild("Animator")

			for _, playingTrack in animator:GetPlayingAnimationTracks() do
				playingTrack:Stop(0)
			end
			
			animScript.idle.Animation1.AnimationId = "http://www.roblox.com/asset/?id=80511069809894"
			animScript.idle.Animation2.Weight.Value = 0
			animScript.fall.FallAnim.AnimationId = "http://www.roblox.com/asset/?id=108018389118675"
			animScript.jump.JumpAnim.AnimationId = "http://www.roblox.com/asset/?id=89563462347179"
			animScript.run.RunAnim.AnimationId = "http://www.roblox.com/asset/?id=71475010221682"
			animScript.walk.WalkAnim.AnimationId = "http://www.roblox.com/asset/?id=116156611636303"
		end
	end)
end)

These are numbers. Animator won’t accept numbers as IDs they must be strings with rbxassetid:// or http://www.roblox.com/asset/?id= .

Change your module to store strings

Movement = {
    Idle = "rbxassetid://80511069809894",
    Walk = "rbxassetid://116156611636303",
    Run  = "rbxassetid://71475010221682",
    Jump = "rbxassetid://89563462347179",
    Fall = "rbxassetid://108018389118675",
},

You can also use the http format if you prefer:


Idle = "http://www.roblox.com/asset/?id=80511069809894",

Either works, just must be a string , not a number.

Try this:

ModuleScript (MagicLibrary)


local MagicLib = {

    ["Fire Magic"] = {
        Name = "Fire Magic";
        Description = nil;

        Movement = {
            Idle = "rbxassetid://80511069809894",
            Walk = "rbxassetid://116156611636303",
            Run  = "rbxassetid://71475010221682",
            Jump = "rbxassetid://89563462347179",
            Fall = "rbxassetid://108018389118675",
        },
    },
}

return MagicLib

Animate Script (in StarterCharacterScripts)

local replicated = game:GetService("ReplicatedStorage")
local magicLib = require(replicated:WaitForChild("MagicLibrary"))

local player = game.Players.LocalPlayer
local playerMagic = player:WaitForChild("Magic")
local magicData = magicLib[playerMagic.Value]
local playerAnims = magicData.Movement

local animNames = { 
    idle = 	{	
        { id = playerAnims.Idle, weight = 9 },
        { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
    },
    walk = 	{ 	
        { id = playerAnims.Walk, weight = 10 } 
    }, 
    run = 	{
        { id = playerAnims.Run, weight = 10 } 
    }, 
    jump = 	{
        { id = playerAnims.Jump, weight = 10 } 
    }, 
    fall = 	{
        { id = playerAnims.Fall, weight = 10 } 
    }, 
    climb = {
        { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 } 
    }, 
    sit = {}
}