2x Flying Script

Hello, Im making it so that you gain coins while flying. I did that, now I need it to work with the 2x XP gamepass! Which I dont know how. You still fly but earn nothing

local player = game.Players.LocalPlayer 
local mouse = player:GetMouse() 
local character = player.Character or player.CharacterAdded:Wait() 
local BV = Instance.new("BodyVelocity",character:WaitForChild("HumanoidRootPart")) 
local speed = 6

local Bind = false
local UIS = game:GetService("UserInputService")
BV.MaxForce = Vector3.new(0,0,0)
UIS.InputBegan:Connect(function(input, gameProcessedEvent)
	if input.KeyCode == Enum.KeyCode.F and not gameProcessedEvent then -- use gameProcessedEvent to check if the player is using chat/interacting with another gui
		if not Bind then
			Bind = true
			BV.MaxForce = Vector3.new(math.huge, math.huge, math.huge)

			while Bind do -- change made here
				if game.Player.LocalPlayer.UserOwnsGamePassAsync(9508306) then
					game.Players.LocalPlayer.leaderstats.XP.Value += 40
					else
				game.Players.LocalPlayer.leaderstats.XP.Value += 20
				wait(5)
				end
			end
		else
			Bind = false
			BV.MaxForce = Vector3.new()
			mouse.Move:Connect(function() 
				BV.Velocity = CFrame.new(character.HumanoidRootPart.Position,mouse.Hit.Position).LookVector * speed
			end)
		end
	end
end) 

Where is code to get the market place service to see if the player has the gamepass?