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

How do I replace the default ROBLOX animations? (run, walk, idle, etc.)

Asked by 6 years ago

I'm making a game, and I need a custom walking animation for it. I've already animated the walk animation but I really need help on how to replace it. I've tried many tutorials online and not a single one of them has worked. Can anyone help? (It's for r15)

0
In the Animate LocalScript User#19524 175 — 6y
0
uh where is that exactly TrixitesWasTaken 13 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

In every player, there is an 'animate' script located in that player's humanoid. In order to override their default animations with YOUR own animation, you'll need to change the walk animation id located inside of the player's animate script. You can complete this task by overriding their walking animation every time a player joins or dies. For example, first you'll want to copy and paste the animate script into the workspace from the player's humanoid. Inside of that script, their should be a piece of code indicating the walking animation id that you can personalize to your own animation id. After changing the id, simply put the new animation script inside of the Replicated Storage tab. Finally create the code that duplicates the animation code and replaces it with the default animation script every time the player joins/dies. In the end, your code should look similar to this example.

local PlayersService = game:GetService("Players")
local newAnimateScript = game.ReplicatedStorage.Animate --Your edited animation script

PlayersService.PlayerAdded:Connect(function(player)
    local newAnimate = newAnimateScript:Clone();
    if player.Character then
        if player.Character.Humanoid:FindFirstChild("Animate") then
            player.Character.Humanoid.Animate:Destroy();
            newAnimate.Parent = player.Character.Humanoid;
        end
    end
end)
0
Can you tell me if there's any difference between game.Players and game:GetService("Players")? LinKiNSpitZ 22 — 6y
0
There's no difference. I just have a habit of using game:GetService("Players") McRocketNuggets 65 — 6y
0
Wow you are getting confused with Javascript. What are the ";"s about?! Lol. PrismaticFruits 842 — 4y
0
It's habit McRocketNuggets 65 — 3y
Ad

Answer this question