So i made a punching script that activates when you press q but it isn't working. There are no error warnings on my output or script analysis. Please help.
local Player = game.Players.LocalPlayer local mouse = Player:GetMouse() local Humanoid = Player.Character.Humanoid local debounce = false mouse.KeyDown:connect(function(key) if not debounce then debounce = true if key == "q" then local Punch = Instance.new("Animation") Punch.AnimationId = "http://www.roblox.com/Asset?ID=644505212" local animTrack = Humanoid:LoadAnimation(Punch) print("fart") animTrack:Play() wait(1) debounce = false end end
You don't need that long of a script to just play an animation when a key is pressed. The reason why the animation doesn't play is because you forgot end) at the very bottom line.
If I'm wrong - I redid it just in case.
local player = game.Players.LocalPlayer local mouse = player:GetMouse() local humanoid = player.Character.Humanoid mouse.KeyDown:connect(function(key) if key == "q" then local anim = Instance.new("Animation") anim.AnimationId = "" -- Animation ID goes here local animTrack = humanoid:LoadAnimation(anim) animTrack:Play() end end)