This is what the script is supposed to do:
Hurt someone, when their right leg touches them, and push them back.
Play an animation, so it looks like their kicking the player.
This is what it's doing:
Hurting me, and damaging me, when I press the key.
Not playing any animations...
This is the script:
wait(2) local player = game.Players.LocalPlayer local mouse = player:GetMouse() repeat wait() until player.Character and player.Character:findFirstChild("Humanoid") mouse.KeyDown:connect(function(key) if key:byte() == 113 then s = player.Character.Humanoid:LoadAnimation(game.Players.Animation) s:Play() player.Character.Humanoid:TakeDamage(50) end end)
I dunno why the animation ain't playing; im not too experienced with those myself. However, the reason you are damaging yourself is written write there: "player.Character.Humanoid:TakeDamage(50)" You literally made the own character take damage :P
I'm not sure if this'll work, because I don' have any animations to test this with. Let me know if this works. I think your mistake was not putting "local" behind your variable "s", which you defined as your animation loaded into your humanoid. If you don't put local, then it won't know to do it to your specific character. If that doesn't work, then I'm sorry. I really don't know much about playing animations and stuff like that.
wait(2) local player = game.Players.LocalPlayer local mouse = player:GetMouse() repeat wait() until player.Character and player.Character:findFirstChild("Humanoid") mouse.KeyDown:connect(function(key) if key:byte() == 113 then local s = player.Character.Humanoid:LoadAnimation(game.Players.Animation) s:Play() player.Character.Humanoid:TakeDamage(50) end end)