# Game

This page has methods that include things like creating developer products and getting game information. The page below introduces you to "promises" which is what is used to handle success and errors with the API.

{% content-ref url="/pages/zxDgxLEmSnCZtoYGdyKR" %}
[Introduction to Promises](/rbxproxy/introduction/introduction-to-promises.md)
{% endcontent-ref %}

### createDeveloperProduct

{% hint style="warning" %}
This method requires authorization
{% endhint %}

{% hint style="warning" %}
This method has to make 3 separate HTTP requests and can take multiple seconds. Keep this in mind if you're for some reason making multiple developer products.
{% endhint %}

This method creates a developer product in the specified game (as long as you have permissions to it)

**Sample code:**

```lua
client.game:createDeveloperProduct(7713167711,{
    name = "testing product",
    description = "hello world",
    price = 30
}):andThen(function(developerProduct)
    print(developerProduct.productId); --> 1211770410
end):catch(warn)
```

#### Arguments:

| Type                                                            | Name    |
| --------------------------------------------------------------- | ------- |
| integer                                                         | placeId |
| array  (name \<string>, description \<string> price \<integer>) | details |

**Returns**: (an example of a successful return in the code above)

```lua
{
    name = "testing product",
    description = "hello world",
    price = 30,
    productId = 1211770410
}
```

### getGameInformation

{% hint style="success" %}
This method does not require authorization.
{% endhint %}

This method returns an array of game information for the specified place.

**Sample code**:

```lua
client.game:getGameInformation(game.PlaceId):andThen(function(info)
    --> do something with this information
end):catch(warn)
```

**Arguments**:

| Type    | Name    |
| ------- | ------- |
| integer | placeId |

#### Returns: \<array> (example below is of my own game)

```lua
{
	["AssetGenre"] = "All",
	["AssetGenreViewModel"] = {
		["DisplayName"] = "All",
		["Id"] = 1
	},
	["AssetId"] = 7701425851,
	["Builder"] = "@Jumpathy",
	["BuilderAbsoluteUrl"] = "https://www.roblox.com/users/87424828/profile/",
	["BuilderId"] = 87424828,
	["Created"] = "10/10/2021",
	["Description"] = "",
	["FavoritedCount"] = 0,
	["IsCopyingAllowed"] = false,
	["IsFavoritedByUser"] = false,
	["IsFavoritesUnavailable"] = false,
	["IsPlayable"] = false,
	["MaxPlayers"] = 50,
	["Name"] = "Proxy Testing",
	["OnlineCount"] = 0,
	["OverridesDefaultAvatar"] = false,
	["PlayButtonType"] = "FancyButtons",
	["Price"] = 0,
	["ReasonProhibited"] = "AnonymousAccessProhibited",
	["ReasonProhibitedMessage"] = "Guest users are not allowed.",
	["ReportAbuseAbsoluteUrl"] = "https://www.roblox.com/abusereport/asset?id=7701425851&RedirectUrl=%2fgames%2f7701425851%2fProxy-Testing",
	["TotalDownVotes"] = 0,
	["TotalUpVotes"] = 0,
	["UniverseId"] = 2989575001,
	["UniverseRootPlaceId"] = 7701425851,
	["Updated"] = "10/11/2021",
	["Url"] = "https://www.roblox.com/games/7701425851/Proxy-Testing",
	["UsePortraitMode"] = false,
	["UserCanManagePlace"] = false,
	["VisitedCount"] = 0,
	["VoiceEnabled"] = false
};
```

### updateDeveloperProduct

{% hint style="warning" %}
This method requires authorization
{% endhint %}

This method updates a specified developer product to the new information you want

**Sample code**:

```lua
client.game:updateDeveloperProduct(7642710810,1212015336,{
    ["name"] = "new",
    ["price"] = 300,
    ["description"] = "yoo"
}):catch(warn):andThen(print)
```

#### Arguments:

| Type                                                            | Name      |
| --------------------------------------------------------------- | --------- |
| integer                                                         | placeId   |
| integer                                                         | productId |
| array  (name \<string>, description \<string> price \<integer>) | details   |

**Returns**: {}

### getGamepasses

{% hint style="success" %}
This method does not require authorization.
{% endhint %}

This method returns gamepasses of the specified game in a page format, if you don't know how to use pages you should check out the guide below.

{% content-ref url="/pages/w77PBjicDtyBgA8Hj8Qn" %}
[Introduction to Pages](/rbxproxy/introduction/introduction-to-pages.md)
{% endcontent-ref %}

**Sample code**:

```lua
client.game:getGamepasses(13822889):andThen(function(results)
    print(results:getCurrentPage())
end):catch(warn);
```

#### Arguments:

| Type    | Name    |
| ------- | ------- |
| integer | placeId |

**Returns**: \<page object>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jumpathy.gitbook.io/rbxproxy/reference/api-reference/game.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
