#Animations not replicating

1 messages · Page 1 of 1 (latest)

tawdry acorn
#

I put a animationid in the standard Animate folder but other players cannot see the new walking animation

strong apex
#

because it is a local file

#

local script*

#

if you want to be able to um

#

have other players see your animations, you'll want to use a normal script

#

this is one of my example scripts, using the animator service

local tool = script.Parent
local players = game:GetService("Players")
local AnimId = "rbxassetid://enter id here"
local AnimationPlaying = false -- Boolean value to track whether or not the animation is playing.


tool.Activated:Connect(function()
    local character = tool.Parent -- Gets the character holding the tool
    local humanoid = character:FindFirstChild("Humanoid")

    if humanoid then
        local animation = Instance.new("Animation") -- Creates an Animation
        animation.AnimationId = AnimId -- Loads the ID of the newly created animation into it.

        local animator = humanoid:FindFirstChild("Animator") -- Finds our Animator

        if not animator then -- If there is no animator, create one.
            animator = Instance.new("Animator")
            animator.Parent = humanoid -- Assign the parent to the player.

        end

        local animationTrack = animator:LoadAnimation(animation) -- Loads the animation
        if AnimationPlaying == false then
            animationTrack:Play() -- Checks if the animation is already playing, if it isnt, play the animation.
            AnimationPlaying = true
        else
            AnimationPlaying = false
        end
    end
end)
#

(this was used for a tool)