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

Why is the animation not playing on my character?

Asked by
Xianon 105
6 years ago
Edited 6 years ago

I'm making a prototype sword for my game and i just wanna make sure things are gonna work. I have made animations before and use them successfully but now I'm having trouble. I equip my sword, i click and the script runs smoothly except for one thing, the animation doesn't play. This is all in a local script and i do load my animation into the humanoid.

local tool = script.Parent

local debounce = true

tool.Activated:connect(function()
    if debounce then
    debounce = false
    local animation = script.attack
    animation.AnimationId = "http://www.roblox.com/Asset?ID=897730969"
    local char = game.Players.LocalPlayer.Character
    local newAnimation = char.Humanoid:LoadAnimation(animation)
    newAnimation:Play()
    local killBrick = script.Parent.Damage
    local kill = killBrick.Touched:connect(function(ply)
        if ply.Parent:FindFirstChild("Humanoid") then
            local humanoid = ply.Parent:FindFirstChild("Humanoid")
            humanoid:TakeDamage(30)
        end
    end)
    wait(2)
    kill:Disconnect()
    debounce = true
    end
end)

Is annoying because i don't even know why

1 answer

Log in to vote
0
Answered by
Xianon 105
6 years ago

Nvm, Animations don't run when you test them in studio...

0
well they do, but maybe your problem was involving the animation being owned by a group DanzLua 2879 — 6y
Ad

Answer this question