I don't know how to code but I attempted something on my own to learn, but I can't seem to understand why it's not working. I do have no experience with Lua C so it may have been a beginner mistake. I'm trying to make it so that when you click the GUI button it prompts a Gamepass purchase if you don't own the gamepass, but if you own the gamepass it teleports you to the place.
local player = game:GetService("Players").LocalPlayer
local TeleportService = game:GetService("TeleportService")
local passID = 7949488
local mapID = 208448432
local MarketPlaceService = game:GetService("MarketplaceService")
local PlayerBoughtThisGamePass = MarketPlaceService:UserOwnsGamePassAsync(player, passID)
script.Parent.MouseButton1Down:Connect(function()
if PlayerBoughtThisGamePass then
TeleportService:Teleport(mapID, player)
else
MarketplaceService:PromptGamePassPurchase(player, passID)
end
end)

2 comments
This is the error I get - Unable to cast Instance to int64
If my answer worked, please accept it.