I want to be able to damage someone when they get hit by this punch how do i go about this and at the same time have the damage linked to your damage stat which is in a leaderstat.

For example say you have 100 strength i want it to do more damage than someone with 15 strength etc. So how can i link the amount of damage this script does to how much strength you have.

local Plr = game.Players.LocalPlayer
local UserInputService = game:GetService("UserInputService")
local Char = Plr.Character or Plr.CharacterAdded:Wait()
local Humanoid = Char:WaitForChild("Humanoid")
local Anim = Instance.new("Animation")
Anim.AnimationId = "rbxassetid://5005123017"
local track = Humanoid:LoadAnimation(Anim)

UserInputService.InputBegan:Connect(function(InputObject)
  if InputObject.UserInputType == Enum.UserInputType.MouseButton1 then
    track:Play()
    wait(10)
  end
end)

3 comments

0

You could make an equation to choose how much your strength multiples your damage and then deal that damage to the humanoid you hit

0

im not sure how to script the part that deals damage

0

When you punch, if you hit a player, you deal damage to them