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

Trying to make an animation, it won't play. Help? (Unanswered)

Asked by
pwnd64 106
9 years ago

Hi, I'm trying to make my first animation for a game I'm working on. I'm having an issue with this animation where everything works fine, it prints 'done' but the animation will not play. I've uploaded to roblox and done everything the wiki says.

Here's the code -

local tool = script.Parent
local player = game.Players.LocalPlayer

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

local animtrack = nil
local canplay = true

script.Parent.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function(hitting)
if canplay == true then
    canplay = false
local playit = player.Character.Humanoid:LoadAnimation(swing)
playit:Play()

canplay = true
print 'done'
end
end)
end)

Answer this question