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

How to add damage for hurting another people to this script?

Player = script.Parent.Parent
	mouse = Player:GetMouse()
	run = game:GetService("RunService")
	function onKeyDown(key)
	    script.Disabled = true
	    Key = key:lower()
	    if key == "q" then
	        RightShoulder = Player.Character.Torso["Right Shoulder"]
	        LeftShoulder = Player.Character.Torso["Left Shoulder"]
	        Run = game:GetService("RunService")
	        for i = 1,10 do
	            LeftShoulder.C0 = LeftShoulder.C0 * CFrame.Angles(0,0,0.155)
	            RightShoulder.C0 = RightShoulder.C0 * CFrame.Angles(0,0,0.155)
	            Run.Stepped:wait(0.025)
	        end
 
	        for i = 1,10 do
	            LeftShoulder.C0 = LeftShoulder.C0 * CFrame.Angles(0,0,-0.155)
	            RightShoulder.C0 = RightShoulder.C0 * CFrame.Angles(0,0,-0.155)
	            Run.Stepped:wait(0.025)
	        end
	    end
	    script.Disabled = false
	    wait(0.1)
	end
	mouse.KeyDown:connect(onKeyDown)

1 answer

✓ Accepted answer

Use the :TakeDamage() method of the Humanoid to apply damage to a player's character.

1 comment

0

oh yea thx

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