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

Why my Custom Player Animations aren't running?

Asked by 5 years ago

I done a Script inside ServerScriptService wich contains 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)

Anyone knows why it removes the animations of the character, but it doesn't load this ones?

0
the only animations that should be loaded on the server should be NPCs. player animations should be done on the client Gey4Jesus69 2705 — 5y
0
So I'll have to put this script in the StarterPlayer? FrikiGameplaysHD 1 — 5y
0
No User#24403 69 — 5y
0
Where do I put it? FrikiGameplaysHD 1 — 5y
View all comments (5 more)
0
You play animations on the player client side, but this requires a rewrite so it works User#24403 69 — 5y
0
And how should the script look? FrikiGameplaysHD 1 — 5y
0
Also why did you make a separate function for onCharacterAdded, why don't you just keep it all in one function? Keep that in mind for the future because as incapaxian said, this will require a rewrite. SteamG00B 1633 — 5y
0
I just followed what the develop.roblox.com official tutorial said FrikiGameplaysHD 1 — 5y
0
So, where should I put the script, and what should I change? FrikiGameplaysHD 1 — 5y

Answer this question