local function y()local y=Instance.new("\080\097\114\116")y.Name="\065\109\109\111"y.FormFactor=Enum.FormFactor.Custom y.Size=Vector3.new()local J=Instance.new("\083\112\101\099\105\097\108\077\101\115\104",y)J.MeshId=ROCKET_MESH_ID J.Scale=ROCKET_MESH_SCALE J.TextureId=ToolHandle.Mesh.TextureId return y end local function J()MyModel=Tool.Parent ReloadRocket=y()end local function K(y)if y=="\069\110\097\098\108\101\100"and Tool.Enabled==false then StillEquipped=true wait(ROCKET_SHOW_TIME)if StillEquipped then local y=MyModel:FindFirstChild("\084\111\114\115\111")if y and y:FindFirstChild("\076\101\102\116 \083\104\111\117\108\100\101\114")then local y=MyModel:FindFirstChild("\076\101\102\116 \065\114\109")if y then local J=ReloadRocket:FindFirstChild("\087\101\108\100")if not J then J=Instance.new("\087\101\108\100")J.Part0=y J.Part1=ReloadRocket J.C1=CFrame.new(Vector3.new(0,1,0))J.Parent=ReloadRocket end ReloadRocket.Parent=MyModel end wait(ROCKET_HIDE_TIME-ROCKET_SHOW_TIME)if StillEquipped and ReloadRocket.Parent==MyModel then ReloadRocket.Parent=nil end end end end end local function l()StillEquipped=false ReloadRocket:Destroy()ReloadRocket=nil end
-----------------
--| Functions |--
-----------------

local function MakeReloadRocket()
	local reloadRocket = Instance.new("Part")
	reloadRocket.Name = "Ammo"
	reloadRocket.FormFactor = Enum.FormFactor.Custom --NOTE: This must be done before changing Size
	reloadRocket.Size = Vector3.new() -- As small as possible

	local mesh = Instance.new("SpecialMesh", reloadRocket)
	mesh.MeshId = ROCKET_MESH_ID
	mesh.Scale = ROCKET_MESH_SCALE
	mesh.TextureId = ToolHandle.Mesh.TextureId

	return reloadRocket
end

local function OnEquipped()
	MyModel = Tool.Parent
	ReloadRocket = MakeReloadRocket()
end

local function OnChanged(property)
	if property == "Enabled" and Tool.Enabled == false then
		-- Show the next rocket going into the launcher
		StillEquipped = true
		wait(ROCKET_SHOW_TIME)
		if StillEquipped then
			local torso = MyModel:FindFirstChild("Torso")
			if torso and torso:FindFirstChild("Left Shoulder") then
				local leftArm = MyModel:FindFirstChild("Left Arm")
				if leftArm then
					local weld = ReloadRocket:FindFirstChild("Weld")
					if not weld then
						weld = Instance.new("Weld")
						weld.Part0 = leftArm
						weld.Part1 = ReloadRocket
						weld.C1 = CFrame.new(Vector3.new(0, 1, 0))
						weld.Parent = ReloadRocket
					end
					ReloadRocket.Parent = MyModel
				end
				wait(ROCKET_HIDE_TIME - ROCKET_SHOW_TIME)
				if StillEquipped and ReloadRocket.Parent == MyModel then
					ReloadRocket.Parent = nil
				end
			end
		end
	end
end

local function OnUnequipped()
	StillEquipped = false
	ReloadRocket:Destroy()
	ReloadRocket = nil
end
