--clockwork


local bin = script.Parent

enabled = true

function explode(pos)
	local lol = Instance.new("Explosion")
	lol.BlastRadius = 10
   lol.BlastPressure = 1
	lol.Position = pos
	lol.Parent = game.Workspace
end

function onButton1Down(mouse)
	if not enabled then return end
	local player = game.Players.LocalPlayer
	if player == nil then return end
	print("trigger")
	-- find the best cf

	enabled = false
	startPos = player.Character.Head.Position
	delta = mouse.Hit.p - startPos
	unit = delta.unit
	for i=0,75 do
		explode(startPos + unit * 20 + i * unit * i / 25)
		wait(.05)
	end
	wait(0)
	enabled = true
end

function onSelected(mouse)
	print("select")
	mouse.Icon = "rbxasset://textures\\GunCursor.png"
	mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end

bin.Selected:connect(onSelected)
