I don't know how to make this script deal damage, it's suppose to be a punch can someone help me out
-- Fixed by Meme Colocal player = game.players.LocalPlayer
local db = true
local damaged = false
local anim = Instance.new("Animation")
anim.AnimationId = "https://www.roblox.com/asset/?id=4804852252"
game.Players.LocalPlayer.Character:WaitForChild("RightHand").Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and not db and not damaged and hit.Parent.Humanoid ~= game.Players.LocalPlayer.Character.Humanoid then
game.ReplicatedStorage.Punch:FireServer(hit.Parent.Humanoid)
end
end)
game:GetService("UserInputService").InputBegan:Connect(function(input, event)
if input.KeyCode == Enum.KeyCode.T and db then
db = false
local playAnim = game.Players.LocalPlayer.Character:WaitForChild("Humanoid"):LoadAnimation(anim)
playAnim:Play()
wait(2)
damaged = false
db = true
end
end)

1 comment
Please format your code and let us see your server sided code.