Advertisement
HowToRoblox

HomestoreScript

Feb 11th, 2022
1,566
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.18 KB | None | 0 0
  1. local clothesIds = {1210857662, 6709022132, 6959669630, 6781213791, 6559275186, 6555794614}
  2.  
  3. local template = script:WaitForChild("Display")
  4.  
  5. local mps = game:GetService("MarketplaceService")
  6. local is = game:GetService("InsertService")
  7.  
  8.  
  9. for i, id in pairs(clothesIds) do
  10.    
  11.     local display = template:Clone()
  12.    
  13.     local productInfo = mps:GetProductInfo(id, Enum.InfoType.Asset)
  14.    
  15.     local name = productInfo.Name
  16.     local price = productInfo.PriceInRobux
  17.    
  18.     display.BuyButton.ClothingDetailsGui.ClothingDetails.Text = name .. "\n" .. price .. " Robux"
  19.    
  20.     local asset = is:LoadAsset(id):GetChildren()[1]
  21.    
  22.     asset.Parent = display.NPC
  23.    
  24.    
  25.     display.BuyButton.ClickDetector.MouseClick:Connect(function(plr)
  26.        
  27.         mps:PromptPurchase(plr, id)
  28.     end)
  29.    
  30.    
  31.     display.TryButton.ClickDetector.MouseClick:Connect(function(plr)
  32.        
  33.         if asset:IsA("Shirt") then
  34.            
  35.             plr.Character.Shirt.ShirtTemplate = asset.ShirtTemplate
  36.            
  37.         elseif asset:IsA("Pants") then
  38.            
  39.             plr.Character.Pants.PantsTemplate = asset.PantsTemplate
  40.         end
  41.     end)
  42.    
  43.     display:SetPrimaryPartCFrame(display.PrimaryPart.CFrame + Vector3.new(0, 0, display.PrimaryPart.Size.Z * (i - 1)))
  44.     display.Parent = workspace
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement