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

Animation is not being played?

Asked by
MrSquer 15
9 years ago

I believe the problem is that it's overwritten, but idk how I'd fix that. This is the script in ServerScriptService (no output):

local Monster = script["Lord Umberhallow"]

game.Players.PlayerAdded:connect(function(Player)
    Player.CharacterAdded:connect(function(Char)
        repeat wait() until game.ContentProvider.RequestQueueSize == 0
        for _, v in pairs(Char:GetChildren()) do
            if v:IsA("Hat") then
                v:Destroy()
            elseif v:IsA("CharacterMesh") then
                v:Destroy()
            end
        end

        for _, v in pairs(Monster:GetChildren()) do
            if v:IsA("CharacterMesh") then
                v:Clone().Parent = Char
            elseif v:IsA("Hat") then
                v:Clone().Parent = Char
            end
        end

        local Mouse = Player:GetMouse()
        local function CreateAnimation(ID)
            local NewAnim = Instance.new("Animation")
            NewAnim.AnimationId = ID
            return NewAnim
        end

        local Animations = {
            Swipe = {
                CreateAnimation(278621260)
            }
        }
        Mouse.Button1Down:connect(function()
            Char.Humanoid:LoadAnimation(Animations.Swipe[math.random(1,#Animations.Swipe)])
        end)
    end)
end)

1 answer

Log in to vote
1
Answered by 9 years ago

I'm assuming you want the player to spawn WITH the walk/idle/jump/fall animation (Whichever animation this is) So I'll give you a script that does just that.

wait(2) -- You can remove this if you'd like.
game.Players.PlayerAdded:connect(function(player)
    while not player.Character do wait() end
    local character = player.Character
    local animateScript = character.Animate
    animateScript.fall.FallAnim.AnimationId = 'http://www.roblox.com/asset/?id=278621260'
end)
Ad

Answer this question