Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you make a t shirt so when someone buys it in game, they get an item?

Asked by 4 years ago
Edited 4 years ago

So i am making an Assassin game, and i want to create a shop to show all the different knifes in the game that people can buy. But i seen in a lot of groups that they have t shirts that gives someone a knife when they buy the t shirt in game. So my question is, what is the script for that to be possible in my game.

heres a link as to what im talking about : https://www.roblox.com/catalog/4868462903/Nightsky-Bundle

1 answer

Log in to vote
0
Answered by 4 years ago

local ASSET_ID = --put the item id here local Players = game:GetService("Players") local MarketplaceService = game:GetService("MarketplaceService") local PlayerOwnsAsset = MarketplaceService.PlayerOwnsAsset Players.PlayerAdded:Connect(function (player) local success, doesPlayerOwnAsset = pcall(PlayerOwnsAsset, MarketplaceService, player, ASSET_ID) if doesPlayerOwnAsset then -- put grant knife skin script here else print(player.Name .. " doesn't own " .. ASSET_NAME) end end)
0
The dev-forum has a nice page for this. I used the same format ever since. For more info on how this works, check this out: https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/PlayerOwnsAssetHeavenlyblobmaster 1 Heavenlyblobmaster 271 — 4y
0
also, if you need help giving the player the knife skin, i can help with that too. Heavenlyblobmaster 271 — 4y
0
so what is the grant knife skin script? javont_sav21 2 — 4y
0
oh Heavenlyblobmaster 271 — 4y
View all comments (3 more)
0
it depends how you are doing it Heavenlyblobmaster 271 — 4y
0
you can use bool values or whatever. But if you want me to like be able to understand, we could dm on discord: BlobMaster#8156 Heavenlyblobmaster 271 — 4y
0
like when someone buys the t shirt product, they receive a knife that the t shirt was scripted to give them. javont_sav21 2 — 4y
Ad

Answer this question