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

How do I change player's animations?

Asked by 5 years ago

I've done a Script in ServerScriptService containing the following code:

local Players = game:GetService("Players")

local function onCharacterAdded(character)
    local humanoid = character:WaitForChild("Humanoid")

    for _, playingTracks in pairs(humanoid:GetPlayingAnimationTracks()) do
        playingTracks:Stop(0)
    end

    local animateScript = character:WaitForChild("Animate")

    animateScript.idle.Animation1.AnimationId = "rbxassetid://5432167890"

    animateScript.walk.WalkAnim.AnimationId = "rbxassetid://1759277502"

    animateScript.jump.JumpAnim.AnimationId = "rbxassetid://1760393958"

    animateScript.fall.FallAnim.AnimationId = "rbxassetid://1760423961"
end

local function onPlayerAdded(player)
    if player.Character then
        onCharacterAdded(player.Character)
    end
    player.CharacterAdded:Connect(onCharacterAdded)
end

Players.PlayerAdded:Connect(onPlayerAdded)

They told me to put this script in another place and change the script, but what should I do?

0
You can run the game, copy the Animate script inside the character, close the session, and paste it into StarterCharacterScripts. Then, you can edit all of the animation ID's inside the Animate script. Rheines 661 — 5y
0
I can't find this "Animate" script FrikiGameplaysHD 1 — 5y
0
It's inside your player's character in the workspace. Rheines 661 — 5y
0
I don't see it FrikiGameplaysHD 1 — 5y
View all comments (6 more)
0
Ok nvm FrikiGameplaysHD 1 — 5y
0
Done, but it doesn't work FrikiGameplaysHD 1 — 5y
0
The animations don't run, the character still has its default animations FrikiGameplaysHD 1 — 5y
0
Weird, it's working in my game. Make sure to delete all descendants of the script (the values) and to recheck the ID inside the animate script again. Rheines 661 — 5y
0
Done and it stills doesn't work FrikiGameplaysHD 1 — 5y
0
Maybe I didn't copy the good script, could you please show me the script that appears to you? FrikiGameplaysHD 1 — 5y

Answer this question