It says "expected 'end' (to close function at line 8), got "
~ ~ ~
bin = script.Parent
me = script.Parent.Parent.Parent
enabled = true
function Talk(msg)
game:GetService("Chat"):Chat(me.Character.Head, msg, Enum.ChatColor.Red)
end
function KeyDown(key)
if key == "z" then
if not enabled then
return
end
local player = game.Players.LocalPlayer
if player == nil then return end
--Here is how i disabled the tool from working after you click once "enabled = false"
enabled = false
LeftShoulder = me.Character.Torso["Left Shoulder"]
RightShoulder = me.Character.Torso["Right Shoulder"]
Neck = me.Character.Torso["Neck"]
value1 = LeftShoulder.C0
value2 = RightShoulder.C0
value3 = Neck.C0
Run = game:GetService("RunService")
RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(-0.5, 0, 0)
LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(-0.5, 0, 0)
wait(0.75)
Neck.C0 = value3
RightShoulder.C0 = value2
LeftShoulder.C0 = value1
wait()
RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0, 0, 1.5)
LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(0, 0, -1.5)
Talk("Air Blast!")
game.Debris:AddItem(ShockWave2, 3)
for a = 1,3 do
local SavedTorsoCFrame = me.Character.Torso.CFrame
ShockWave2 = Instance.new("Part")
ShockWave2.Parent = Workspace
ShockWave2.Size = Vector3.new(5,5,5)
ShockWave2.formFactor = "Symmetric"
ShockWave2.Anchored = true
ShockWave2.Shape = "Block"
ShockWave2.CanCollide = false
ShockWave2.Transparency = 0
ShockWave2.TopSurface = "Smooth"
ShockWave2.BottomSurface = "Smooth"
ShockWave2.BrickColor = BrickColor.new("White")
ShockWave2.CFrame = SavedTorsoCFrame * CFrame.new(0, 0, -10) * CFrame.Angles(1.57, 0, 0)
m = Instance.new("SpecialMesh")
m.Parent = ShockWave2
m.MeshType = "Sphere"
m.Scale = Vector3.new(1, 1, 1)
game.Debris:AddItem(ShockWave2, 3)
for i = 1, 20 do
wait(0.01)
ShockWave1 = Instance.new("Part")
ShockWave1.Parent = Workspace
ShockWave1.Size = Vector3.new(5,5,5)
ShockWave1.formFactor = "Symmetric"
ShockWave1.Anchored = true
ShockWave1.Shape = "Block"
ShockWave1.CanCollide = false
ShockWave1.Transparency = 0
ShockWave1.TopSurface = "Smooth"
ShockWave1.BottomSurface = "Smooth"
zomg = math.random(1, 2)
if zomg == 1 then
ShockWave1.BrickColor = BrickColor.new("Pastel light blue")
end
if zomg == 2 then
ShockWave1.BrickColor = BrickColor.new("White")
end
ShockWave1.Name = "ShockWavePart"
m = Instance.new("CylinderMesh")
m.Parent = ShockWave1
m.Scale = Vector3.new(1, 1, 1)
game.Debris:AddItem(ShockWave1, 2)
ShockWave1.CFrame = SavedTorsoCFrame * CFrame.new(0, 0, -(i*20)) * CFrame.Angles(1.57, 0, 0)
for u, c in pairs(workspace:GetChildren()) do
if c.Name ~= me.Character.Name then
h = c:findFirstChild("Humanoid")
t = c:findFirstChild("Torso")
if h ~= nil and t ~= nil then
if (ShockWave1.Position-t.Position).magnitude <= 20 then
h:TakeDamage(10)
h.Sit = true
end
end
end
end
end
wait(1)
end
LeftShoulder.C0 = value1
RightShoulder.C0 = value2
wait(0.25)
--Heres how long you want it to be before you use it again change wait(2) to anything u want
wait(4)
--Here is how i made it able to work again after the time has run out "enabled = true"
enabled = true
end
--You can keep all this below i guess
enabled = true
function onS(key)
key.KeyDown:connect(function() onKeyDown(key) end)
end
bin.Selected:connect(onS)

2 comments
Error at line 126
You're missing some ends for your If's at the function on line 8