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

Can someone help me with my script?

Asked by
red106 0
10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

I was trying to make a skill script, but I wanted like when a player sets a text box as a key that when you press the key it would do the move. Can someone help me ?

This is the script if you need to see it.

local enabled = true
Player = script.Parent.Parent
--Player:WaitForDataReady()
mouse = Player:GetMouse()
run = game:GetService("RunService")
function onKeyDown(key)
if not enabled then return end
enabled = false
    Key = key:lower()
    if key == "z" then
        RightShoulder = Player.Character.Torso["Right Shoulder"]
        LeftShoulder = Player.Character.Torso["Left Shoulder"]
        Run = game:GetService("RunService")
        for i = 1, 2 do
            for i = 1, 12 do
                LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(0, 0, -0.16)
                RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, 0, 0.16)
                RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, 0.1, 0)
                LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(0, -0.1, 0)
                Run.Stepped:wait(0.01)
            end
            for i = 1, 12 do
                LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(0, 0.1, 0)
                RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, -0.1, 0)
                LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(0, 0, 0.16)
                RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, 0, -0.16)
                Run.Stepped:wait(0.005)
            end
        end
            for i = 1, 12 do
                LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(0, 0, -0.16)
                RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, 0, 0.16)
                RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, 0.1, 0)
                LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(0, -0.1, 0)
                Run.Stepped:wait(0.005)
            end
        game:GetService("Chat"):Chat(Player.Character.Head, "Destructive Art HADO33!")
        x = Instance.new("Part")
        x.BrickColor = BrickColor.new("Bright red")
        x.Size = Vector3.new(1, 1, 1)
        x.TopSurface = "Smooth"
        x.BottomSurface = "Smooth"
        x.Shape = "Ball"
        x.Name = Player.Name
        x.CanCollide = false
        x.Transparency = 0.7
        fd = script.Firedamage:clone()
        fd.Parent = x
        y = Instance.new("BodyVelocity")
        y.maxForce = Vector3.new(math.huge, math.huge, math.huge)
        y.velocity = Player.Character.Torso.CFrame.lookVector*80
        x.Parent = Workspace
        y.Parent = x
        f = Instance.new("Fire", x)
        f.Size = 0
        f.Heat = 0
        x.CFrame = Player.Character.Torso.CFrame*CFrame.new(0, 0, -12)
        fd.Disabled = false
        game.Debris:AddItem(x, 6)
        wait(0.25)
        for i = 1, 12 do
            LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(0, 0.1, 0)
            RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, -0.1, 0)
            LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(0, 0, 0.16)
            RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, 0, -0.16)
            Run.Stepped:wait(0.01)
        end
    end
wait(2)
enabled = true
end

mouse.KeyDown:connect(onKeyDown)
0
I'm not going to bother to answer if you don't put exactly what you need. Saying you want a textbox means nothing. c0des 207 — 10y
0
No I was going to put the text box in a frame and the when a player puts the text box as a key the script would activate. red106 0 — 10y
0
Here is the problem, posting 73 lines of code and then expecting us to do something with an unclear description of what you want is like walking into a room of preschoolers and telling them that they need to do Calc. Vathriel 510 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

First of all what key do you want to be pressed to do the move

local enabled = true
Player = script.Parent.Parent
--Player:WaitForDataReady()
mouse = Player:GetMouse()
run = game:GetService("RunService")
function onKeyDown(KEY)-------- replace KEY with the key you want pressed
if not enabled then return end
enabled = false
    Key = key:lower()
    if key == "z" then
        RightShoulder = Player.Character.Torso["Right Shoulder"]
        LeftShoulder = Player.Character.Torso["Left Shoulder"]
        Run = game:GetService("RunService")
        for i = 1, 2 do
            for i = 1, 12 do
                LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(0, 0, -0.16)
                RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, 0, 0.16)
                RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, 0.1, 0)
                LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(0, -0.1, 0)
                Run.Stepped:wait(0.01)
            end
            for i = 1, 12 do
                LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(0, 0.1, 0)
                RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, -0.1, 0)
                LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(0, 0, 0.16)
                RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, 0, -0.16)
                Run.Stepped:wait(0.005)
            end
        end
            for i = 1, 12 do
                LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(0, 0, -0.16)
                RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, 0, 0.16)
                RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, 0.1, 0)
                LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(0, -0.1, 0)
                Run.Stepped:wait(0.005)
            end
        game:GetService("Chat"):Chat(Player.Character.Head, "Destructive Art HADO33!")
        x = Instance.new("Part")
        x.BrickColor = BrickColor.new("Bright red")
        x.Size = Vector3.new(1, 1, 1)
        x.TopSurface = "Smooth"
        x.BottomSurface = "Smooth"
        x.Shape = "Ball"
        x.Name = Player.Name
        x.CanCollide = false
        x.Transparency = 0.7
        fd = script.Firedamage:clone()
        fd.Parent = x
        y = Instance.new("BodyVelocity")
        y.maxForce = Vector3.new(math.huge, math.huge, math.huge)
        y.velocity = Player.Character.Torso.CFrame.lookVector*80
        x.Parent = Workspace
        y.Parent = x
        f = Instance.new("Fire", x)
        f.Size = 0
        f.Heat = 0
        x.CFrame = Player.Character.Torso.CFrame*CFrame.new(0, 0, -12)
        fd.Disabled = false
        game.Debris:AddItem(x, 6)
        wait(0.25)
        for i = 1, 12 do
            LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(0, 0.1, 0)
            RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, -0.1, 0)
            LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(0, 0, 0.16)
            RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, 0, -0.16)
            Run.Stepped:wait(0.01)
        end
    end
wait(2)
enabled = true
end

mouse.KeyDown:connect(onKeyDown)

0
I want them to be able to put there own key in a text box, and then when they press that key it does the move. red106 0 — 10y
Ad

Answer this question