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

How do i make the ball do damage?

Asked by 9 years ago
local enabled = true
Player = script.Parent.Parent
character = Player.CharacterAdded:wait();
mouse = Player:GetMouse()
RightShoulder = Player.Character.Torso["Right Shoulder"]
LeftShoulder = Player.Character.Torso["Left Shoulder"]
function onKeyDown(key)
    key = key:lower()
    if key == "x" then
        game:GetService("Chat"):Chat(Player.Character.Head, "Heaven!")
        for i = 1,2 do
            RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, 0, 10)
            wait(0.25)
            RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, 0, -10) 
        end
        game:GetService("Chat"):Chat(Player.Character.Head, "Hell!")
        for i = 1,2 do
            LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(0, 0, 10)
            wait(0.25)
            LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(0, 0, -10)
        end
        game:GetService("Chat"):Chat(Player.Character.Head, "Crash!")
        b = Instance.new ("Part")
        b.BrickColor = BrickColor.new("Bright violet")
        b.Shape = "Ball"
        b.Size = Vector3.new(3, 3, 3)
        b.TopSurface = "Smooth"
        b.BottomSurface = "Smooth"
        b.CanCollide = false
        b.Anchored = false
        b.CFrame = Player.Character.Torso.CFrame *CFrame.new(0, 0, -12)
        b.Parent = workspace
        game.Debris:AddItem(b,6)
        b2 = Instance.new("Part")
        b2.BrickColor = BrickColor.new("Lavender")
        b2.Shape = "Ball"
        b2.Size = Vector3.new(5, 5, 5)
        b2.TopSurface = "Smooth"
        b2.BottomSurface = "Smooth"
        b2.Transparency = 0.7
        b2.CanCollide = false
        b2.Anchored = false
        b2.CFrame = Player.Character.Torso.CFrame *CFrame.new(0, 0, -12)
        b2.Parent = b
        game.Debris:AddItem(b2,6)
        y = Instance.new("BodyVelocity")
        y.maxForce = Vector3.new(math.huge, math.huge, math.huge)
        y.velocity = Player.Character.Torso.CFrame.lookVector*80
        y.Parent = b
        f = Instance.new("Fire")
        f.Size = 5
        f.Heat = 15
        f.Color = Color3.new(101, 101, 152)
        f.SecondaryColor = Color3.new(170, 170, 255)
        f.Parent = b        
        weld = Instance.new("Weld")
        weld.Part0 = b2
        --weld.C0 = b2.CFrame:inverse()
        weld.Part1 = b
        weld.Parent = b
    end
end

mouse.KeyDown:connect(onKeyDown)

1 answer

Log in to vote
0
Answered by 9 years ago

Dude, I said on your last post, the mouse can only be accessed through a LocalScript. With that said, your KeyDown event does not fire.

0
It is an local script kingalpha1 15 — 9y
0
Can't you see the tag? kingalpha1 15 — 9y
Ad

Answer this question