-- Import animation local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/Asset?ID=219254264" -- Local variables local animTrack = nil local canPlay = true local deb = false function playGrabAnim(Source) if canPlay then local player = game.Players.LocalPlayer.Character canPlay = false animTrack = player.Humanoid:LoadAnimation(animation) -- Load animation into Humanoid animTrack.KeyframeReached:connect(function(keyframeName) -- Bind function to KeyframeReached event end) end end script.Parent.Activated:connect(function() if deb == false then deb = true animTrack:Play() end wait(2) deb = false end)
Also could you tell me how i would disable the arm from going up when the tool is equipped?
Try using the Equipped
Function instead of using Activated
-- Import animation local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/Asset?ID=219254264" -- Local variables local animTrack = nil local canPlay = true local deb = false function playGrabAnim(Source) if canPlay then local player = game.Players.LocalPlayer.Character canPlay = false animTrack = player.Humanoid:LoadAnimation(animation) -- Load animation into Humanoid animTrack.KeyframeReached:connect(function(keyframeName) -- Bind function to KeyframeReached event end) end end script.Parent.Equipped:connect(function() -- see how I used the Equipped function. if deb == false then deb = true animTrack:Play() end wait(2) deb = false end)