script.Parent.poopi.OnServerEvent:Connect(function()local y=MyPlayer.Character if Tool.Enabled and(y and(y:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")and y.Humanoid.Health>0))then Tool.Enabled=false local y=MouseLoc:InvokeClient(MyPlayer)local k=Rocket:Clone()DebrisService:AddItem(k,30)k.BrickColor=MyPlayer.TeamColor local S=(ToolHandle.CFrame*CFrame.new(5,0,0)).p k.CFrame=CFrame.new(S,y)k.Velocity=k.CFrame.lookVector*ROCKET_SPEED k.Parent=workspace k:SetNetworkOwner(nil)wait(RELOAD_TIME)Tool.Enabled=true end end)function OnEquipped()MyPlayer=PlayersService:GetPlayerFromCharacter(Tool.Parent)end
-----------------
--| Functions |--
-----------------

script.Parent.poopi.OnServerEvent:Connect(function()
	local myModel = MyPlayer.Character
	if Tool.Enabled and myModel and myModel:FindFirstChildOfClass("Humanoid") and myModel.Humanoid.Health > 0 then
		Tool.Enabled = false
		local Pos = MouseLoc:InvokeClient(MyPlayer)
		-- Create a clone of Rocket and set its color
		local rocketClone = Rocket:Clone()
		DebrisService:AddItem(rocketClone, 30)
		rocketClone.BrickColor = MyPlayer.TeamColor

		-- Position the rocket clone and launch!
		local spawnPosition = (ToolHandle.CFrame * CFrame.new(5, 0, 0)).p
		rocketClone.CFrame = CFrame.new(spawnPosition, Pos) --NOTE: This must be done before assigning Parent
		rocketClone.Velocity = rocketClone.CFrame.lookVector * ROCKET_SPEED --NOTE: This should be done before assigning Parent
		rocketClone.Parent = workspace
		rocketClone:SetNetworkOwner(nil)

		wait(RELOAD_TIME)

		Tool.Enabled = true
	end
end)

function OnEquipped()
	MyPlayer = PlayersService:GetPlayerFromCharacter(Tool.Parent)
end
