Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

my punch script plays the animation and sound but doesn't do damage any ideas?

i fixed it so it does damage but now it does constant damage when a player touches another players right arm any ideas on how to fix this? (its r15)

game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(Char) local sound = game.ServerStorage.Punch:Clone() sound.Parent = Char:WaitForChild("Head") end) end)

game.ReplicatedStorage.Punch.OnServerEvent:Connect(function(player) local char = player.Character or player.CharacterAdded:wait() local rarm = char:WaitForChild("RightHand") rarm.Touched:connect(function(hit) local dmg = true local hum = hit.Parent:FindFirstChild("Humanoid") if hum then dmg = false hum:TakeDamage(5) wait(0.5) dmg = true end end)

player.Character.Head.Punch:Play()

end)

1 answer

Well you could take an easy way out and make an instance that does damage on hit at the end of the fist using Instance.new("Part", --Whatever your fist is) then use a debounce to make it hit on the time you need it, but like i said this is an easy way out, and i don't know how to make damaging punches, hope this helps.

This discussion is preserved as it was. New answers, comments, and votes are closed.