I'm currently trying to make a fighting game where when you left click you can play a punching animation. I cant figure out how to make this, so can someone help me?
COMMUNITY QUESTION
How do I make a script using the mousebutton1click function?
1 answer
--local script
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local animation = 0 --ANIMATION ID HERE
mouse.Button1Down:Connect(function()
animTrack = player.Character.Humanoid:LoadAnimation(animation) -- Load animation into Humanoid
animTrack:Play()
end)
3 comments
0
@gingeylol It keeps saying humanoid isnt a valid member of player
0
oops
0
player.Character.Humanoid:LoadAnimation(animation)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
I've already made the punching animation.