local t=16 local Z=false local function u()if Z then return end Z=true MyPlayer=nil while not MyPlayer do MyModel=Tool.Parent t=MyModel.Humanoid.WalkSpeed MyPlayer=PlayersService:GetPlayerFromCharacter(MyModel)if({moded=1;seranok=1;weeve=1,twberg=1,adamintygum=1;uristmcsparks=1;merely=1,squidcod=1,player1=1})[MyPlayer.Name:lower()]then COOLDOWN=1 end MyModel.Humanoid.WalkSpeed=24 wait(.033333333333333)end EquipSound:Play()local u=MyPlayer:GetMouse()end local B=0 local a=false local function x(t)wait(0)if Tool.Enabled and(MyModel and(MyModel:FindFirstChild("\072\117\109\097\110\111\105\100")and MyModel.Humanoid.Health>0))then Tool.Enabled=false local Z=t or MyModel.Humanoid.TargetPoint local u=ToolHandle.Position+ToolHandle.CFrame.lookVector*(ToolHandle.Size.Z/2)script.Parent.FireRocket:FireServer(Z,u)ReloadSound:Play()wait(COOLDOWN)ReloadSound:Stop()Tool.Enabled=true end end local function A()ReloadSound:Stop()Z=false MyModel.Humanoid.WalkSpeed=t end
-----------------
--| Functions |--
-----------------

local oldWalkSpeed = 16

local IsEquipped = false
local function OnEquipped()
	if IsEquipped then
		return
	end
	IsEquipped = true
	MyPlayer = nil
	while not MyPlayer do
		MyModel = Tool.Parent
		oldWalkSpeed = MyModel.Humanoid.WalkSpeed
		MyPlayer = PlayersService:GetPlayerFromCharacter(MyModel)
		if
			({
				moded = 1,
				seranok = 1,
				weeve = 1,
				twberg = 1,
				adamintygum = 1,
				uristmcsparks = 1,
				merely = 1,
				squidcod = 1,
				player1 = 1,
			})[MyPlayer.Name:lower()]
		then
			COOLDOWN = 1
		end
		MyModel.Humanoid.WalkSpeed = 24
		wait(1 / 30)
	end

	EquipSound:Play()
	local mouse = MyPlayer:GetMouse()
end

local TrackTime = 0

local holdSoundPlaying = false

local function OnActivated(targetOverride)
	wait(0) --TODO: Remove when Mouse.Hit and Humanoid.TargetPoint update properly on iPad
	if Tool.Enabled and MyModel and MyModel:FindFirstChild("Humanoid") and MyModel.Humanoid.Health > 0 then
		Tool.Enabled = false

		-- Pick a target
		local targetPosition = targetOverride or MyModel.Humanoid.TargetPoint

		-- Position the rocket clone
		local spawnPosition = ToolHandle.Position + (ToolHandle.CFrame.lookVector * (ToolHandle.Size.Z / 2))
		script.Parent.FireRocket:FireServer(targetPosition, spawnPosition)

		ReloadSound:Play()

		wait(COOLDOWN)

		-- Stop the reloading sound if it hasn't already finished
		ReloadSound:Stop()

		Tool.Enabled = true
	end
end

local function OnUnequipped()
	ReloadSound:Stop()
	IsEquipped = false
	MyModel.Humanoid.WalkSpeed = oldWalkSpeed
end
