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

How do i fix this error?

Asked by 9 years ago
wait(0.01)
local enabled = true
Player = game.Players.LocalPlayer
character = Player.Character
mouse = Player:GetMouse()
run = game:GetService("RunService")
RS = Player.Character.Torso["Right Shoulder"]
LS = Player.Character.Torso["Left Shoulder"]

function onKeyDown(key)
    key = key:lower()
    if key == "x" then
        for i = 1,5 do
            RS.C0 = RS.C0 *CFrame.Angles(0, 0, 0.5)
            wait()
        end
        for i = 1,5 do
            RS.C0 = RS.C0 *CFrame.Angles(0, 0, -0.5)
            wait()
        end
        for i = 1,5 do
            LS.C0 = LS.C0 *CFrame.Angles(0, 0, -0.5)
            wait()
        end
        for i = 1,5 do
            LS.C0 = LS.C0 *CFrame.Angles(0, 0, 0.5)
            wait()
        end
        script.Parent.Touched:connect(function(hit)
            if hit.Parent:IsA("Model") then
            if hit.Parent:FindFirstChild("Humanoid") ~= nil then
            hit.Parent["Humanoid"].Health = hit.Parent["Humanoid"].Health - 5
        end
    end
end)

    end
end

mouse.KeyDown:connect(onKeyDown)

Touched is not a valid member of Backpack

0
I'm trying to make a punching script,so you can imagine what i want. kingalpha1 15 — 9y

Answer this question