how can I give something to the player if he/she bought?
local plr = game:GetService("Players").LocalPlayer
local Market = game:GetService("MarketplaceService")
local devProduct = script.Parent.DevProduct
local function buy()
script.Parent.MouseButton1Click:Connect(function() buy() end)
script.Parent.ImageButton.MouseButton1Click:Connect(function() buy() end)
-- \\ Server script //
local Player = game.Players:GetPlayerByUserId(RecieptInfo.PlayerId)
if not Player then
if Player then
print("Player is still in game..")
if RecieptInfo.ProductId == YourProductId then
print("Player has bought a devproduct!")
game:GetService("MarketPlaceService").ProcessReciept = GiveItem
Put this in a completely new script (Server Script)
So I have to use remote event?
No. Just add this script in a completely new server script.
Yeah but I am using a localscript for buttons so I have to do with a remote event.
Oh changed my script, and no need for remote events…? This happens right after a purchase is bought. Use my changed script. Don’t worry about any remote events.
Ah I thought I have to use remote event to call the function or something like it.
Thank for your help, have a good day !
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.