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

Can someone tell me whats wrong with this animation?

Asked by
neoG457 315 Moderation Voter
9 years ago
local enabled = true
mouse = Player:GetMouse()
function onKeyDown(key)
if not enabled then return end
enabled = false
    Key = key:lower()
    if key == "x" then

local animation = Instance.new("Animation")
    animation.AnimationId = "http://www.roblox.com/Asset?ID=220836646"

        local player = game.Players.Character


            local animTrack = player.humanoid:LoadAnimation(animation)
            animTrack:Play()


        wait(2)
    enabled = true
end

            mouse.KeyDown:connect(onKeyDown)

The animation should play once I press X But it wont, can somebody tell me whats wrong with it?

1 answer

Log in to vote
0
Answered by
yumtaste 476 Moderation Voter
9 years ago

You didn't define Player. If the problem persists, I can rewrite your code for you.

0
Okay, thank you. neoG457 315 — 9y
0
But something more specific would be nice. neoG457 315 — 9y
0
Is your code still broken?\ yumtaste 476 — 9y
Ad

Answer this question