-- Location: game.ReplicatedStorage.Consume
-- Synapse Decompiler
-- Purchase Here: https://brack4712.xyz/synapse/purchase/


wait(0.5)
Tool = script.Parent
local play = game.Players.LocalPlayer
local char = play.Character
local root = char:WaitForChild("HumanoidRootPart")
local hum = char:WaitForChild("Humanoid")
local inair = false
char.Humanoid.FreeFalling:connect(function()
	inair = true
end)
char.Humanoid.Running:connect(function()
	inair = false
end)
function weldTogether(x, y)
	local W = Instance.new("Weld")
	W.Part0 = x
	W.Part1 = y
	local CJ = CFrame.new(x.Position)
	local C0 = x.CFrame:inverse() * CJ
	local C1 = y.CFrame:inverse() * CJ
	W.C0 = C0
	W.C1 = C1
	W.Parent = x
	return W
end
en = true
function onButton1Down(mouse)
	if en == true and inair == false and root.Position.y > 1 then
		en = false
		local point = root.Position + mouse.Hit.lookVector * 100
		local can = Tool.Handle:clone()
		can.Anchored = true
		can.CFrame = CFrame.new(root.Position, point)
		local nm = Instance.new("IntValue")
		nm.Name = "Speed"
		nm.Value = -10000
		if hum:findFirstChild("Effects") then
			nm.Parent = hum:findFirstChild("Effects")
		end
		can.Parent = root
		Tool.Handle.Transparency = 1
		can.Fuse:Play()
		local weld = weldTogether(can, root)
		wait(5)
		weld:Destroy()
		can.Fuse:Stop()
		can.Boom:Play()
		if hum then
			hum.Sit = true
		end
		root.Velocity = CFrame.new(root.Position, point).lookVector * 250
		local e = Instance.new("Explosion")
		e.BlastPressure = 0
		e.Position = (can.CFrame * CFrame.new(0, 0, 2)).p
		e.Parent = can
		wait(1)
		nm.Parent = nil
		can:Destroy()
		wait(10)
		Tool.Handle.Transparency = 0
		en = true
	end
end
function Equip(mouse)
	mouse.Icon = "rbxasset://textures\\GunCursor.png"
	mouse.Button1Down:connect(function()
		onButton1Down(mouse)
	end)
end
function Unequip(mouse)
end
script.Parent.Equipped:connect(Equip)
script.Parent.Unequipped:connect(Unequip)
