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

Wiring in game purchases to produce game commission?

Asked by 4 years ago
Edited 4 years ago

I made an in game catalog where you could wear any item from the catalog. I also made it so that you could buy it from the real catalog while in game. How would I wire the script so that I get commissions from any purchases made through the catalog?

--[[if script.Parent~=workspace.CurrentCamera then
    repeat wait() script.Parent=workspace.CurrentCamera

    until script.Parent==workspace.CurrentCamera
end
repeat wait() script.Parent=nil until script.Parent==nil
print(script.Parent," is my parent")--]]
local plr=game.Players.LocalPlayer; repeat wait() until plr.Character
local char = plr.Character
local catChar=nil
local rot=0
local tim = tick()
local curAnim = nil
local run=game:GetService('RunService')
local input=game:GetService'UserInputService'
local mouseCnn={}
local deviceT="MouseButton1Down"
local ghost = {}
local trooper=require(script.Parent:WaitForChild'cloneTrooper')
local market=game:GetService'MarketplaceService'

local catalog=script.Parent
local menu=catalog:WaitForChild'Menus':WaitForChild'Catalog'
local cover=menu:WaitForChild('Cover')
local comm=game.ReplicatedStorage:WaitForChild'Com'
local function rota()
    spawn(function()
        while cover.Visible do
            cover:WaitForChild'ImageLabel'.Rotation=cover:WaitForChild'ImageLabel'.Rotation+1
            game:GetService'RunService'.RenderStepped:wait()
        end
    end)
end
cover.Changed:connect(function()
    if cover.Visible then rota() end
end)
function loadCat()
local head=menu:WaitForChild("Header")
local ex=menu:WaitForChild("Example")
local frmEx=menu:WaitForChild'FrameEx'
local nav=menu:WaitForChild('Nav')
local purchase=game.ReplicatedStorage:WaitForChild('ITEM_PURCHASE')
local stuff=game.ReplicatedStorage:WaitForChild('Items')
local get_query=game.ReplicatedStorage:WaitForChild('SEARCH')
local page=1
local turning=false
local footer=menu:WaitForChild('Footer')
local frm=menu:WaitForChild('Container')
local searching=false
local query=''
local searches={}
print('Loaded most global variables!')
local search_type='Accessories'
local hat_={}
local clickeds={}
head.Search.FocusLost:connect(function(enterPressed)


local wearingFX={}
nav:WaitForChild'Display':WaitForChild'wear'.MouseButton1Down:connect(function()
    click();flood(nav:WaitForChild'Display':WaitForChild'wear')
    purchase:InvokeServer(hat_[1],hat_[2],hat_[3])
    local box=Instance.new("Frame",hat_[4]);wearingFX[hat_[1]]=box
    box.Size=UDim2.new(0,10,0,10)
    box.BackgroundColor3=Color3.new(1/255, 150/255, 213/255)
    box.BorderSizePixel=0
    box.Position=UDim2.new(0,10,0,10)
    box.ZIndex=4
    desModel()
    loadModel()
end)

-- The relevant part below

nav:WaitForChild'Display':WaitForChild'buy'.MouseButton1Down:connect(function()
    click();flood(nav:WaitForChild'Display':WaitForChild'wear')
    market:PromptPurchase(plr,hat_[3])
end)

plr.Character.DescendantRemoving:connect(function(c)
    local nam=c.Name
    if wearingFX[nam] then
        c.Name="NULL"
        if not plr.Character:findFirstChild(nam) then
            wearingFX[nam]:Destroy()
        end
    end
end)

i deleted parts of the script and left only the relevant part becuase it was over 10,000 words

0
you wait 3 days User#24403 69 — 4y

1 answer

Log in to vote
0
Answered by
DanzLua 2879 Moderation Voter Community Moderator
4 years ago

As long as your script prompts the catalog item and the user purchases it, you'll receive commission.

No need to do anything else :D

0
Really? Because I tested this out by purchasing something myself and no commission was received... LiLFriks 39 — 4y
0
@LiLFriks maybe because you were buying it from your own game. But roblox takes care of it for you DanzLua 2879 — 4y
0
Yeah :( i just had one of my friend purchase something and i got no commissions :( LiLFriks 39 — 4y
0
@LiLFriks Is the place in a group? DanzLua 2879 — 4y
View all comments (3 more)
0
no, it's not... does that affect it? LiLFriks 39 — 4y
0
@LiLFriks no, but it would affect where you viewed the income from. Maybe the period of time it takes for it to be logged acts the same as when you get your money like incapaxx said. Because you SHOULD get commission when you sell third party items. DanzLua 2879 — 4y
0
okay! thanks! LiLFriks 39 — 4y
Ad

Answer this question