Simulator & tycoon kit
Gifting: buy for a friend
A player picks someone in the server, or one of their Roblox friends, and everything they buy in the shop with Robux goes to that player, even if they already left. Its id in GameData is gifting.
Turn it on#
- On the website, switch on Gifting and Robux Products in your design's Extras panel (Data Saving comes on too), then export and install. Robux Products sells the shop's items, and Gifting sends them to someone else.
- Give the shop's Robux items their ids in
GameData.Products, and say what each one gives:["Gem Pack"] = { id = 1234567890, price = 49, gives = { gems = 500 }, ... }(how). - Press Play, open the shop and press Gift on an item.
- Publish and test with two accounts: gifts to players in another server, or offline, need the live game.
How it works for players#
- In the shop, a Gift button opens the Gift Player picker: players in the server first, then the player's friends, with a search box.
- They pick someone. The shop's tag now says GIFTING TO and the name, and everything they buy in the shop goes to that player, for
targetMinutesor until they press the tag's X. - The friend gets a toast and a pop-up saying who it's from. Not in this server? The gift waits in their mailbox and arrives in their server, or the next time they join.
- Only players in the same server or Roblox friends can be picked, never yourself (unless
allowSelf). - What can be gifted:
GameData.Products(gem and cash packs) and Timed Boosts. Skip Rebirth and offline claims are for the buyer and never gifted. - Every gift is delivered exactly once, even if Roblox sends the purchase again.
- There are no typed messages, because they'd need Roblox's text filter.
The settings#
| Setting | What it means | Starts as |
|---|---|---|
shopGifting | Pick a player, then every Robux product bought in the shop goes to them. | true |
giftableSystems | Whose products can be gifted: products (GameData.Products) and boosts (Timed Boosts). | "products, boosts" |
targetMinutes | How long a picked player stays picked. | 30 |
allowSelf | Players may pick themselves. | false |
pickerElement | The id of your design's Gift picker. Missing? A built-in picker opens instead. | "GiftPicker" |
showButton, button | Show a GIFT button on screen, or open the picker from your own button's id. A gifting shop has its own Gift buttons, so it doesn't need one. | true, empty |
gifts | Optional gift packs (below). | 2 examples |
Gift packs (optional)#
Most games don't need them: gifting from the shop covers everything. Gift packs are extra products made only for gifting, sold from the GIFT button: pick a player, then a pack.
GameData.Features.gifting
gifts = {
{ id = "coins_gift", label = "Coin Gift", productId = 1234567890,
kind = "currency", currency = "coins", item = "", amount = 1000, icon = "gift" },
{ id = "boost_gift", label = "2x Coins Gift", productId = 0,
kind = "boost", currency = "coins", item = "coins", amount = 30, icon = "boost" },
},- Each pack needs its own developer product, separate from anything players buy for themselves: one product belongs to one system.
kindis"currency","item"(the item's id initem) or"boost"(the boost's id initem,amountin minutes; needs Timed Boosts).- A pack with
productId = 0isn't sold.
Troubleshooting#
- Output says
gifting from the shop needs Robux Products (products) or Timed Boosts (boosts) on: switch on Robux Products on the website and install again. - Output says
no gift pack has a productId yet: fine if you only gift from the shop. Paste ids intogiftsto sell packs. - A purchase went to the buyer: no player was picked, or the pick ran out (
targetMinutes). The shop's tag shows who purchases go to. - A player can't be picked: they must be in the same server or a Roblox friend of the buyer.
- A friend in another server didn't get it yet: it arrives within a few minutes, or on their next join. This only works in the published game.
- The purchase prompt appears but nothing is granted: the product id isn't in
GameData.Products, or Robux Products is switched off (Output:no blueprint product with productId ...), or the entry has nogives(Output:Products["Gem Pack"] gives nothing yet).