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

1 comment
you wait 3 days