Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you make a player receive an item, after they clicked a part?

So, im making an assassin game, and i have part that whenever someone clicks it they can purchase a t shirt. My problem is i want them to receive this; https://www.roblox.com/catalog/1340206957/Black-Hole-Sword when they click the part and buy my t shirt. So my question is, what script do i use for that to happen?

heres what im trying to make: https://www.roblox.com/catalog/4864121104/Crystal-Blade-Bundle

in that game, if a player buys that shirt, they receive that bundle in the game.

The part I have already has a click detector, I want players to click the part and buy my T-shirt. Once they buy my shirt, I want them to receive a Knife bundle that I made.

2 answers

To do it you will need a CLICK DETECTOR And the code this is the script that you will need to put in the block

local CLICK_BLOCK = script.Parent local ITEM_ID = 1340206957 --ID number of shirt

local Click = Instance.new("ClickDetector",CLICK_BLOCK)

Click.MouseClick:connect(function(p) game:GetService("MarketplaceService"):PromptPurchase(p,ITEM_ID) end)

But if you are doing pants then you will need this script

local CLICK_BLOCK = script.Parent local ITEM_ID = --ID Number of pant

local Click = Instance.new("ClickDetector",CLICK_BLOCK)

Click.MouseClick:connect(function(p) game:GetService("MarketplaceService"):PromptPurchase(p,ITEM_ID) end)

Use a ClickDetector, If you don't know how to use it then know how to here.

1 comment

0

Make sure it's using a server script too. Tools tend to not work properly when given by a local script

This discussion is preserved as it was. New answers, comments, and votes are closed.