i have tried may methods but it keeps saying: unable to cast value to object, here is my code:

local passId = 13118751 -- change this to your game pass ID.
local player = game.Players.LocalPlayer
player.PlayerGui:WaitForChild("AdminGUI")
local current = player.PlayerGui.AdminGUI

script.Parent.MouseButton1Click:Connect(function()
	if game:GetService("MarketplaceService"):PlayerOwnsAsset(player, passId) then 
		current.Enabled = true
	else
		game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer, passId)
	end
end)