Part Cannon

Part Cannon

local button = script.Parent


local click = button.ClickDetector


local gate = game.Workspace.Gate


local respawn = game.Workspace.Respawn


local function shoot_ball()

button.BrickColor = BrickColor.new('Really red')

local ball = Instance.new('Part')

ball.Shape = Enum.PartType.Ball

ball.Size = Vector3.new(1.5,1.5,1.5)

ball.BrickColor = BrickColor.new('Black')

ball.Position = respawn.Position

ball.Parent = game.Workspace

gate.Transparency = 1

gate.CanCollide = false

wait(3)

button.BrickColor = BrickColor.new('Lime green')

gate.Transparency = 0

gate.CanCollide = true

end


click.MouseClick:Connect(shoot_ball)