I’ve been getting an error when trying to pull a gamepass ID out of a table, and it keeps throwing the error unable to cast value to object
. Ive printed the ID and it gives me back 1.
["Team Description"] = "Keep watch in the fire tower for bushfires!",
["Team"] = teamsService["Snowkins State Park Fire & Rescue"],
["Type"] = "Gamepass",
["ID"] = 1,
local id = teamTable["ID"]
if marketPlaceService:UserOwnsGamePassAsync(localPlayer.UserId, tonumber(teamTable["ID"])) then
setTeam(teamsService[textButton.Name])
else
marketPlaceService:PromptGamePassPurchase(localPlayer.UserId, tonumber(teamTable["ID"]))
marketPlaceService.PromptGamePassPurchaseFinished:Connect(function(localPlayer, ID, complete)
if complete then
setTeam(teamsService[textButton.Name])
end
end)
end