Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 7 years ago
Edited 7 years ago
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

Log in to vote
0
Answered by 7 years ago

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

0
oh yea thx deantay4 10 — 7y
Ad

Answer this question