Advertisement
immbr05

40%

Mar 8th, 2025
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 27.44 KB | Gaming | 0 0
  1. local marketPlaceService = game:GetService("MarketplaceService")
  2. local runService = game:GetService("RunService")
  3. local lighting = game:GetService("Lighting")
  4. local logService = game:GetService("LogService")
  5. local replicatedStorage = game:GetService("ReplicatedStorage")
  6. local teleportService = game:GetService("TeleportService")
  7. local tweenService = game:GetService("TweenService")
  8. local players = game:GetService("Players")
  9.  
  10. local textColours = {
  11.     Success = Color3.fromRGB(93, 255, 98),
  12.     Error = Color3.fromRGB(255, 103, 103),
  13.     Warn = Color3.fromRGB(255, 241, 85)
  14. }
  15.  
  16. local mainFrame = script.Parent.MainFrame
  17. local settingsFrame = script.Parent.SettingsFrame
  18. local informationFrame = script.Parent.InformationFrame
  19. local notifList = script.Parent.Notifications
  20. local hoverText = script.Parent.HoverText
  21.  
  22. local toggleTabs = mainFrame:WaitForChild("ToggleTabs")
  23. local toggleInformation, closeInformation = mainFrame:WaitForChild("ToggleInformation"), informationFrame:WaitForChild("Close")
  24. local toggleSettings, closeSettings = mainFrame:WaitForChild("ToggleSettings"), settingsFrame:WaitForChild("Close")
  25. local closeMain, openMain = mainFrame:WaitForChild("Close"), script.Parent:WaitForChild("Open")
  26.  
  27. local tabFrames = mainFrame:WaitForChild("Tabs")
  28. local tabButtons = mainFrame:WaitForChild("TabButtons")
  29. local templates = replicatedStorage:WaitForChild("UITemplates")
  30.  
  31. local notifText = templates.NotificationText
  32.  
  33. local buyItemEvent = replicatedStorage.Events.BuyItem
  34. local sniperFunction = replicatedStorage.Functions.EditSniper
  35. local settingsFunction = replicatedStorage.Functions.ChangeSetting
  36.  
  37. local buyItem, itemInput = tabFrames.Accessories.BuyItem, tabFrames.Accessories.InputFrame.Input
  38. local buyBundle, bundleInput = tabFrames.Bundles.BuyBundle, tabFrames.Bundles.InputFrame.Input
  39. local buyPass, passInput = tabFrames.Passes.BuyPass, tabFrames.Passes.InputFrame.Input
  40. local toggleRetry = tabFrames.Sniper.ToggleRetry
  41.  
  42. local colourScheme = settingsFrame.ColourScheme
  43. local modeFrame = settingsFrame.Mode
  44.  
  45. local sniperConnections = {}
  46. local sniperData = {}
  47. local rainbowMode = false
  48. local loadingSniper = false
  49. local switchingTabs = false
  50. local switchingColour = false
  51. local switchingMode = false
  52. local switchingWindow = false
  53. local activeWindow = "None"
  54. local activeTab = ""
  55.  
  56. function playSound(soundName: string)
  57.    
  58.     replicatedStorage.Sounds:FindFirstChild(soundName):Play()
  59.    
  60. end
  61.  
  62. function assetOnsale(assetId)
  63.    
  64.     local assetData = marketPlaceService:GetProductInfo(assetId, Enum.InfoType.Asset)
  65.    
  66.     return assetData["IsForSale"]
  67.    
  68. end
  69.  
  70. function color3Colour(colour: string)
  71.  
  72.     if colour == "RGB" then
  73.  
  74.         return colour
  75.  
  76.     end
  77.  
  78.     local colourData = colour:split(", ")
  79.  
  80.     return Color3.fromRGB(tonumber(colourData[1]), tonumber(colourData[2]), tonumber(colourData[3]))
  81.  
  82. end
  83.  
  84. function updateSniperLayout()
  85.    
  86.     tabFrames.Sniper.CurrentSnipeFrame.CanvasSize = UDim2.new(0, 0, 0, tabFrames.Sniper.CurrentSnipeFrame.UIListLayout.AbsoluteContentSize.Y + 150)
  87.     tabFrames.Sniper.CurrentSnipeFrame.UIListLayout.Padding = UDim.new(0, math.floor((script.Parent.AbsoluteSize.Y / 160) + 0.5))
  88.  
  89.     local newSize = (tabFrames.Sniper.CurrentSnipeFrame.AbsoluteSize.X - tabFrames.Sniper.CurrentSnipeFrame.ScrollBarThickness) * 0.95
  90.     local newCellSize = UDim2.new(0, newSize, 0, newSize * 0.35)
  91.  
  92.     for _, item in pairs(tabFrames.Sniper.CurrentSnipeFrame:GetChildren()) do
  93.  
  94.         if item:IsA("Frame") then
  95.  
  96.             item.Size = newCellSize
  97.             item.Visible = true
  98.  
  99.         end
  100.  
  101.     end
  102.    
  103. end
  104.  
  105. function updateSniper(snipeData)
  106.    
  107.     if loadingSniper == false then
  108.        
  109.         loadingSniper = true
  110.  
  111.         for _, item in pairs(tabFrames.Sniper.CurrentSnipeFrame:GetChildren()) do
  112.  
  113.             if item:IsA("Frame") then
  114.  
  115.                 local success, error = pcall(function()
  116.  
  117.                     sniperConnections[item.Name]:Disconnect()
  118.                     sniperConnections[item.Name] = nil
  119.  
  120.                 end)
  121.  
  122.                 item:Destroy()
  123.  
  124.             end
  125.  
  126.         end
  127.  
  128.         if snipeData ~= {} then
  129.            
  130.             for index, newData in pairs(snipeData) do
  131.                
  132.                 local assetId = newData["itemId"]
  133.                 local retry = newData["retry"]
  134.                 local uuid = newData["uuid"]
  135.  
  136.                 local newFrame = templates.TemplateFrame:Clone()
  137.                 newFrame.Name = assetId
  138.                 newFrame.LayoutOrder = index
  139.  
  140.                 local itemData
  141.  
  142.                 local success, error = pcall(function()
  143.  
  144.                     itemData = marketPlaceService:GetProductInfo(assetId, Enum.InfoType.Asset)
  145.  
  146.                 end)
  147.  
  148.                 newFrame.ItemIcon.Image = "https://www.roblox.com/asset-thumbnail/image?assetId=" .. assetId .. "&width=420&height=420&format=png"
  149.                 newFrame.ItemName.Text = itemData["Name"]
  150.                 newFrame.Retry.Text = "Retry: " .. (retry and "On" or "Off")
  151.  
  152.                 newFrame.Parent = tabFrames.Sniper.CurrentSnipeFrame
  153.  
  154.                 task.spawn(function()
  155.  
  156.                     sniperConnections[tostring(assetId)] = runService.Stepped:Connect(function()
  157.  
  158.                         if not assetOnsale(assetId) then
  159.  
  160.                             newFrame.Tries.Text = (tonumber(newFrame.Tries.Text) + 1)
  161.  
  162.                         else
  163.  
  164.                             local success, error = pcall(function()
  165.  
  166.                                 sniperConnections[tostring(assetId)]:Disconnect()
  167.                                 sniperConnections[tostring(assetId)] = uuid
  168.  
  169.                             end)
  170.  
  171.                             playSound("SniperReleased")
  172.  
  173.                             buyItemEvent:FireServer({itemType = "Accessory", id = assetId})
  174.  
  175.                             marketPlaceService.PromptPurchaseFinished:Connect(function(player, newAssetId)
  176.  
  177.                                 if assetId == newAssetId then
  178.                                    
  179.                                     if uuid == sniperConnections[tostring(assetId)] then
  180.  
  181.                                         if retry and sniperConnections[tostring(assetId)] ~= nil then
  182.  
  183.                                             buyItemEvent:FireServer({itemType = "Accessory", id = assetId})
  184.  
  185.                                         else
  186.  
  187.                                             local message, newData = sniperFunction:InvokeServer({Action = "Remove", id = tonumber(newFrame.Name)})
  188.                                             newFrame:Destroy()
  189.  
  190.                                         end
  191.  
  192.                                     end
  193.  
  194.                                 end
  195.  
  196.                             end)
  197.  
  198.                         end
  199.  
  200.                     end)
  201.  
  202.                 end)
  203.  
  204.                 newFrame:FindFirstChild("Remove").MouseButton1Click:Connect(function()
  205.  
  206.                     local message, newData = sniperFunction:InvokeServer({Action = "Remove", id = tonumber(newFrame.Name)})
  207.  
  208.                     createNotif(message["message"], message["messageType"])
  209.  
  210.                     if message["message"] == "Success" then
  211.                        
  212.                         if sniperConnections[tostring(assetId)] ~= nil then
  213.                            
  214.                             if type(sniperConnections[tostring(assetId)]) ~= "string" then
  215.                                
  216.                                 sniperConnections[tostring(assetId)]:Disconnect()
  217.                                
  218.                             end
  219.                            
  220.                             sniperConnections[tostring(assetId)] = nil
  221.                            
  222.                         end
  223.                        
  224.                         updateSniper(newData["Sniper"])
  225.  
  226.                     end
  227.  
  228.                 end)
  229.  
  230.                 updateSniperLayout()
  231.  
  232.             end
  233.  
  234.             loadingSniper = false
  235.            
  236.         end
  237.        
  238.     else
  239.        
  240.         createNotif("Sniper Loading", "Error")
  241.        
  242.     end
  243.    
  244. end
  245.  
  246. function createNotif(text: string, notifType: string)
  247.  
  248.     if #notifList:GetChildren() < 5 then
  249.        
  250.         local newText = notifText:Clone()
  251.         newText.Text = text
  252.         newText.TextColor3 = textColours[notifType]
  253.         newText.Size = UDim2.new(0.95, 0, 0, 0)
  254.         newText.Visible = true
  255.         newText.Parent = notifList
  256.        
  257.         if notifType == "Success" then
  258.            
  259.             playSound("Success")
  260.            
  261.         else
  262.            
  263.             playSound("Error")
  264.            
  265.         end
  266.  
  267.         tweenService:Create(newText, TweenInfo.new(0.25, Enum.EasingStyle.Back), { Size = UDim2.new(0.95, 0, 0.593, 0) }):Play()
  268.  
  269.         task.delay(5, function()
  270.  
  271.             tweenService:Create(newText, TweenInfo.new(0.15), { Size = UDim2.new(0.95, 0, 0, 0) }):Play()
  272.  
  273.             task.wait(0.15)
  274.  
  275.             newText:Destroy()
  276.  
  277.         end)
  278.        
  279.     end
  280.  
  281. end
  282.  
  283. function changeMode(newMode: string)
  284.    
  285.     if switchingMode == false and modeFrame:FindFirstChild(newMode).Check.Visible == false then
  286.        
  287.         switchingMode = true
  288.        
  289.         task.delay(0.5, function()
  290.            
  291.             switchingMode = false
  292.            
  293.         end)
  294.        
  295.         for _, item in pairs(modeFrame:GetChildren()) do
  296.  
  297.             if item:IsA("ImageButton") then
  298.  
  299.                 if item.Name == newMode then
  300.  
  301.                     item.Check.ImageTransparency = 1
  302.                     item.Check.Visible = true
  303.  
  304.                     tweenService:Create(item.Check, TweenInfo.new(0.5), { ImageTransparency = 0.1 }):Play()
  305.  
  306.                 else
  307.  
  308.                     task.delay(0.5, function()
  309.  
  310.                         item.Check.Visible = false
  311.  
  312.                     end)
  313.  
  314.                     tweenService:Create(item.Check, TweenInfo.new(0.5), { ImageTransparency = 1 }):Play()
  315.  
  316.                 end
  317.  
  318.             end
  319.  
  320.         end
  321.  
  322.         if newMode == "Light" and script.Parent:GetAttribute("Mode") == "Dark" then
  323.  
  324.             script.Parent:SetAttribute("Mode", "Light")
  325.  
  326.             modeFrame.Dark.Check.Visible = false
  327.  
  328.             mainFrame:FindFirstChild("DarkMode"):Destroy()
  329.             settingsFrame:FindFirstChild("DarkMode"):Destroy()
  330.             informationFrame:FindFirstChild("DarkMode"):Destroy()
  331.  
  332.             local newGradient01, newGradient02, newGradient03 = templates.Gradients.LightMode:Clone(), templates.Gradients.LightMode:Clone(), templates.Gradients.LightMode:Clone()
  333.             newGradient01.Parent = mainFrame
  334.             newGradient02.Parent = settingsFrame
  335.             newGradient03.Parent = informationFrame
  336.            
  337.             templates.TemplateFrame.BackgroundColor3 = Color3.fromRGB(158, 158, 158)
  338.            
  339.             for _, item in pairs(tabFrames.Sniper.CurrentSnipeFrame:GetChildren()) do
  340.                
  341.                 if item:IsA("Frame") then
  342.                    
  343.                     item.BackgroundColor3 = Color3.fromRGB(158, 158, 158)
  344.                    
  345.                 end
  346.                
  347.             end
  348.            
  349.  
  350.             tweenService:Create(mainFrame, TweenInfo.new(0.5), { BackgroundColor3 = Color3.fromRGB(255, 255, 255) }):Play()
  351.             tweenService:Create(settingsFrame, TweenInfo.new(0.5), { BackgroundColor3 = Color3.fromRGB(255, 255, 255) }):Play()
  352.             tweenService:Create(informationFrame, TweenInfo.new(0.5), { BackgroundColor3 = Color3.fromRGB(255, 255, 255) }):Play()
  353.  
  354.             tweenService:Create(mainFrame.Title, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(0, 0, 0) }):Play()
  355.             tweenService:Create(settingsFrame.Title, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(0, 0, 0) }):Play()
  356.             tweenService:Create(informationFrame.Title, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(0, 0, 0) }):Play()
  357.            
  358.             tweenService:Create(informationFrame.InformationText, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(0, 0, 0) }):Play()
  359.             tweenService:Create(informationFrame.InformationText2, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(0, 0, 0) }):Play()
  360.             tweenService:Create(informationFrame.DonationText, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(0, 0, 0) }):Play()
  361.             tweenService:Create(mainFrame.Watermark, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(0, 0, 0) }):Play()
  362.  
  363.             tweenService:Create(settingsFrame.ColourScheme.SettingTitle, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(0, 0, 0) }):Play()
  364.  
  365.             tweenService:Create(mainFrame.Tabs.Sniper.SniperText, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(0, 0, 0) }):Play()
  366.             tweenService:Create(mainFrame.Tabs.Sniper.CurrentSnipeText, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(0, 0, 0) }):Play()
  367.  
  368.             tweenService:Create(mainFrame.ToggleTabs, TweenInfo.new(0.5), { ImageColor3 = Color3.fromRGB(0, 0, 0) }):Play()
  369.             tweenService:Create(mainFrame.ToggleSettings, TweenInfo.new(0.5), { ImageColor3 = Color3.fromRGB(0, 0, 0) }):Play()
  370.             tweenService:Create(mainFrame.ToggleInformation, TweenInfo.new(0.5), { ImageColor3 = Color3.fromRGB(0, 0, 0) }):Play()
  371.  
  372.         elseif newMode == "Dark" and script.Parent:GetAttribute("Mode") == "Light" then
  373.  
  374.             script.Parent:SetAttribute("Mode", "Dark")
  375.  
  376.             mainFrame:FindFirstChild("LightMode"):Destroy()
  377.             settingsFrame:FindFirstChild("LightMode"):Destroy()
  378.             informationFrame:FindFirstChild("LightMode"):Destroy()
  379.  
  380.             local newGradient01, newGradient02, newGradient03 = templates.Gradients.DarkMode:Clone(), templates.Gradients.DarkMode:Clone(), templates.Gradients.DarkMode:Clone()
  381.             newGradient01.Parent = mainFrame
  382.             newGradient02.Parent = settingsFrame
  383.             newGradient03.Parent = informationFrame
  384.            
  385.             templates.TemplateFrame.BackgroundColor3 = Color3.fromRGB(31, 31, 31)
  386.  
  387.             for _, item in pairs(tabFrames.Sniper.CurrentSnipeFrame:GetChildren()) do
  388.  
  389.                 if item:IsA("Frame") then
  390.  
  391.                     item.BackgroundColor3 = Color3.fromRGB(31, 31, 31)
  392.  
  393.                 end
  394.  
  395.             end
  396.  
  397.             tweenService:Create(mainFrame, TweenInfo.new(0.5), { BackgroundColor3 = Color3.fromRGB(20, 20, 20) }):Play()
  398.             tweenService:Create(settingsFrame, TweenInfo.new(0.5), { BackgroundColor3 = Color3.fromRGB(20, 20, 20) }):Play()
  399.             tweenService:Create(informationFrame, TweenInfo.new(0.5), { BackgroundColor3 = Color3.fromRGB(20, 20, 20) }):Play()
  400.  
  401.             tweenService:Create(mainFrame.Title, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(255, 255, 255) }):Play()
  402.             tweenService:Create(settingsFrame.Title, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(255, 255, 255) }):Play()
  403.             tweenService:Create(informationFrame.Title, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(255, 255, 255) }):Play()
  404.            
  405.             tweenService:Create(informationFrame.InformationText, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(255, 255, 255) }):Play()
  406.             tweenService:Create(informationFrame.InformationText2, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(255, 255, 255) }):Play()
  407.             tweenService:Create(informationFrame.DonationText, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(255, 255, 255) }):Play()
  408.             tweenService:Create(mainFrame.Watermark, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(255, 255, 255) }):Play()
  409.  
  410.             tweenService:Create(settingsFrame.ColourScheme.SettingTitle, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(255, 255, 255) }):Play()
  411.  
  412.             tweenService:Create(mainFrame.Tabs.Sniper.SniperText, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(255, 255, 255) }):Play()
  413.             tweenService:Create(mainFrame.Tabs.Sniper.CurrentSnipeText, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(255, 255, 255) }):Play()
  414.  
  415.             tweenService:Create(mainFrame.ToggleTabs, TweenInfo.new(0.5), { ImageColor3 = Color3.fromRGB(255, 255, 255) }):Play()
  416.             tweenService:Create(mainFrame.ToggleSettings, TweenInfo.new(0.5), { ImageColor3 = Color3.fromRGB(255, 255, 255) }):Play()
  417.             tweenService:Create(mainFrame.ToggleInformation, TweenInfo.new(0.5), { ImageColor3 = Color3.fromRGB(255, 255, 255) }):Play()
  418.  
  419.         end
  420.        
  421.     end
  422.    
  423. end
  424.  
  425. function changeColourScheme(newColour: Color3)
  426.    
  427.     if switchingColour == false then
  428.        
  429.         switchingColour = true
  430.        
  431.         task.delay(0.5, function()
  432.            
  433.             switchingColour = false
  434.            
  435.         end)
  436.        
  437.         if newColour == "RGB" then
  438.            
  439.             rainbowMode = true
  440.            
  441.         else
  442.            
  443.             rainbowMode = false
  444.            
  445.             for _, descendant in pairs(script.Parent:GetDescendants()) do
  446.  
  447.                 if descendant:GetAttribute("Theme") then
  448.  
  449.                     if descendant:IsA("ScrollingFrame") then
  450.  
  451.                         tweenService:Create(descendant, TweenInfo.new(0.5), { ScrollBarImageColor3 = newColour }):Play()
  452.  
  453.                     else
  454.  
  455.                         tweenService:Create(descendant, TweenInfo.new(0.5), { BackgroundColor3 = newColour }):Play()
  456.  
  457.                     end
  458.  
  459.                 end
  460.  
  461.             end
  462.            
  463.         end
  464.  
  465.         for _, button in pairs(colourScheme.Colours:GetChildren()) do
  466.  
  467.             if button:IsA("ImageButton") then
  468.  
  469.                 if button.BackgroundColor3 == newColour or button.Name == newColour then
  470.  
  471.                     button.Check.ImageTransparency = 1
  472.                     button.Check.Visible = true
  473.  
  474.                     tweenService:Create(button.Check, TweenInfo.new(0.5), { ImageTransparency = 0.1 }):Play()
  475.  
  476.                 else
  477.  
  478.                     task.delay(0.5, function()
  479.  
  480.                         button.Check.Visible = false
  481.  
  482.                     end)
  483.  
  484.                     tweenService:Create(button.Check, TweenInfo.new(0.5), { ImageTransparency = 1 }):Play()
  485.  
  486.                 end
  487.  
  488.             end
  489.  
  490.         end
  491.        
  492.     end
  493.    
  494. end
  495.  
  496. function switchTabs(tabName: string)
  497.    
  498.     if switchingTabs == false and activeTab ~= tabName then
  499.        
  500.         switchingTabs = true
  501.         activeTab = tabName
  502.  
  503.         task.delay(0.8, function()
  504.  
  505.             switchingTabs = false
  506.  
  507.         end)
  508.        
  509.         for _, frame in pairs(tabFrames:GetChildren()) do
  510.  
  511.             if frame:IsA("Frame") then
  512.                
  513.                 if frame.Visible == true then
  514.                    
  515.                     tweenService:Create(frame, TweenInfo.new(0.75, Enum.EasingStyle.Back), { Position = UDim2.new(frame.Position.X.Scale, 0, -0.75, 0) }):Play()
  516.                    
  517.                     task.delay(0.8, function()
  518.                        
  519.                         frame.Visible = false
  520.                         frame.Position = UDim2.new(frame.Position.X.Scale, 0, 1.5, 0)
  521.                        
  522.                     end)
  523.                    
  524.                 end
  525.  
  526.                 tweenService:Create(tabButtons:FindFirstChild(frame.Name).UIGradient, TweenInfo.new(0.5), { Offset = Vector2.new(-0.5, 0) }):Play()
  527.  
  528.             end
  529.  
  530.         end
  531.  
  532.         tabFrames:FindFirstChild(tabName).Visible = true
  533.         tweenService:Create(tabFrames:FindFirstChild(tabName), TweenInfo.new(0.75, Enum.EasingStyle.Back), { Position = UDim2.new(tabFrames:FindFirstChild(tabName).Position.X.Scale, 0, 0.566, 0) }):Play()
  534.         tweenService:Create(tabButtons:FindFirstChild(tabName).UIGradient, TweenInfo.new(0.5), { Offset = Vector2.new(0, 0) }):Play()
  535.        
  536.     end
  537.    
  538. end
  539.  
  540. function switchWindow(windowName: string)
  541.    
  542.     if switchingWindow ~= true and activeWindow ~= windowName then
  543.        
  544.         local availableWindows = {informationFrame, mainFrame, settingsFrame}
  545.        
  546.         switchingWindow = true
  547.         activeWindow = windowName
  548.        
  549.         task.delay(0.8, function()
  550.            
  551.             switchingWindow = false
  552.            
  553.         end)
  554.        
  555.         if windowName == "None" then
  556.            
  557.             task.delay(0.25, function()
  558.                
  559.                 lighting.DiscountBlur.Enabled = false
  560.                 lighting.DiscountColor.Enabled = false
  561.                
  562.             end)
  563.            
  564.             tweenService:Create(lighting.DiscountBlur, TweenInfo.new(0.25), { Size = 0 }):Play()
  565.             tweenService:Create(lighting.DiscountColor, TweenInfo.new(0.25), { Brightness = 0 }):Play()
  566.             tweenService:Create(lighting.DiscountColor, TweenInfo.new(0.25), { Saturation = 0 }):Play()
  567.            
  568.             for _, newWindow in pairs(availableWindows) do
  569.                
  570.                 if newWindow.Visible == true then
  571.                    
  572.                     tweenService:Create(newWindow, TweenInfo.new(0.75, Enum.EasingStyle.Back), { Position = UDim2.new(0.5, 0, -0.5, 0) }):Play()
  573.  
  574.                     task.delay(0.8, function()
  575.  
  576.                         newWindow.Visible = false
  577.                         newWindow.Position = UDim2.new(0.5, 0, 1.5, 0)
  578.  
  579.                     end)
  580.                    
  581.                 end
  582.                
  583.             end
  584.            
  585.         else
  586.            
  587.             lighting.DiscountBlur.Enabled = true
  588.             lighting.DiscountColor.Enabled = true
  589.            
  590.             tweenService:Create(lighting.DiscountBlur, TweenInfo.new(0.25), { Size = 24 }):Play()
  591.             tweenService:Create(lighting.DiscountColor, TweenInfo.new(0.25), { Brightness = -0.25 }):Play()
  592.             tweenService:Create(lighting.DiscountColor, TweenInfo.new(0.25), { Saturation = -0.5 }):Play()
  593.            
  594.             for _, newWindow in pairs(availableWindows) do
  595.  
  596.                 if newWindow.Visible == true then
  597.  
  598.                     tweenService:Create(newWindow, TweenInfo.new(0.75, Enum.EasingStyle.Back), { Position = UDim2.new(0.5, 0, -0.5, 0) }):Play()
  599.  
  600.                     task.delay(0.8, function()
  601.  
  602.                         newWindow.Visible = false
  603.                         newWindow.Position = UDim2.new(0.5, 0, 1.5, 0)
  604.  
  605.                     end)
  606.  
  607.                 end
  608.  
  609.             end
  610.            
  611.             local newFrame = script.Parent:FindFirstChild(windowName .. "Frame")
  612.            
  613.             newFrame.Visible = true
  614.             tweenService:Create(newFrame, TweenInfo.new(0.75, Enum.EasingStyle.Back), { Position = UDim2.new(0.5, 0, 0.5, 0) }):Play()
  615.            
  616.         end
  617.        
  618.     end
  619.    
  620. end
  621.  
  622. for _, button in pairs(script.Parent:GetDescendants()) do
  623.    
  624.     if button:IsA("ImageButton") then
  625.        
  626.         button.MouseEnter:Connect(function()
  627.            
  628.             playSound("Hover")
  629.            
  630.         end)
  631.        
  632.         button.MouseButton1Click:Connect(function()
  633.            
  634.             playSound("Click")
  635.            
  636.         end)
  637.        
  638.     end
  639.    
  640. end
  641.  
  642. for _, button in pairs(tabButtons:GetChildren()) do
  643.    
  644.     if button:IsA("ImageButton") then
  645.        
  646.         button.MouseButton1Click:Connect(function()
  647.            
  648.             switchTabs(button.Name)
  649.            
  650.         end)
  651.        
  652.     end
  653.    
  654. end
  655.  
  656. toggleTabs.MouseButton1Click:Connect(function()
  657.    
  658.     if switchingTabs == false then
  659.        
  660.         toggleTabs:SetAttribute("Toggled", not toggleTabs:GetAttribute("Toggled"))
  661.  
  662.         if toggleTabs:GetAttribute("Toggled") then
  663.  
  664.             for _, frame in pairs(tabFrames:GetChildren()) do
  665.  
  666.                 if frame:IsA("Frame") then
  667.  
  668.                     tweenService:Create(frame, TweenInfo.new(0.55, Enum.EasingStyle.Back), { Position = UDim2.new(0.633, 0, frame.Position.Y.Scale, 0) }):Play()
  669.  
  670.                 end
  671.  
  672.             end
  673.  
  674.             tweenService:Create(tabButtons, TweenInfo.new(0.5, Enum.EasingStyle.Back), { Position = UDim2.new(0, 0, 0.43, 0) }):Play()
  675.  
  676.         else
  677.  
  678.             for _, frame in pairs(tabFrames:GetChildren()) do
  679.  
  680.                 if frame:IsA("Frame") then
  681.  
  682.                     tweenService:Create(frame, TweenInfo.new(0.55, Enum.EasingStyle.Back), { Position = UDim2.new(0.5, 0, frame.Position.Y.Scale, 0) }):Play()
  683.  
  684.                 end
  685.  
  686.             end
  687.  
  688.             tweenService:Create(tabButtons, TweenInfo.new(0.5, Enum.EasingStyle.Back), { Position = UDim2.new(-0.3, 0, 0.43, 0) }):Play()
  689.  
  690.         end
  691.        
  692.     end
  693.    
  694. end)
  695.  
  696. informationFrame.GetModel.MouseButton1Click:Connect(function()
  697.  
  698.     marketPlaceService:PromptPurchase(players.LocalPlayer, 15202854806)
  699.  
  700. end)
  701.  
  702. informationFrame.Donate.MouseButton1Click:Connect(function()
  703.  
  704.     teleportService:Teleport(6972275856, players.LocalPlayer)
  705.  
  706. end)
  707.  
  708. for _, button in pairs(colourScheme.Colours:GetChildren()) do
  709.    
  710.     if button:IsA("ImageButton") then
  711.        
  712.         button.MouseButton1Click:Connect(function()
  713.            
  714.             if not button.Check.Visible then
  715.                
  716.                 if button.Name == "RGB" then
  717.                    
  718.                     local message, newData = settingsFunction:InvokeServer({Action = "ChangeColour", Value = "RGB"})
  719.                    
  720.                     createNotif(message["message"], message["messageType"])
  721.                     changeColourScheme(color3Colour(newData["Colour"]))
  722.                    
  723.                 else
  724.                    
  725.                     local message, newData = settingsFunction:InvokeServer({Action = "ChangeColour", Value = button.BackgroundColor3})
  726.                    
  727.                     createNotif(message["message"], message["messageType"])
  728.                     changeColourScheme(color3Colour(newData["Colour"]))
  729.                    
  730.                 end
  731.                
  732.             else
  733.                
  734.                 createNotif("Colour Already Selected", "Error")
  735.                
  736.             end
  737.            
  738.         end)
  739.        
  740.     end
  741.    
  742. end
  743.  
  744. for _, button in pairs(modeFrame:GetChildren()) do
  745.  
  746.     if button:IsA("ImageButton") then
  747.  
  748.         button.MouseButton1Click:Connect(function()
  749.            
  750.             if not button.Check.Visible then
  751.                
  752.                 local message, newData = settingsFunction:InvokeServer({Action = "ChangeMode", Value = button.Name})
  753.                
  754.                 createNotif(message["message"], message["messageType"])
  755.                 changeMode(newData["Mode"])
  756.                
  757.             else
  758.                
  759.                 createNotif("Mode Already Selected", "Error")
  760.                
  761.             end
  762.            
  763.         end)
  764.  
  765.     end
  766.  
  767. end
  768.  
  769. toggleRetry.MouseButton1Click:Connect(function()
  770.    
  771.     local message, newData = settingsFunction:InvokeServer({Action = "ToggleRetry"})
  772.    
  773.     toggleRetry.ButtonText.Text = "Retry: " .. (newData["Retry"] and "On" or "Off")
  774.    
  775.     createNotif(message["message"], message["messageType"])
  776.    
  777. end)
  778.  
  779. toggleSettings.MouseButton1Click:Connect(function()
  780.    
  781.     switchWindow("Settings")
  782.    
  783. end)
  784.  
  785. closeSettings.MouseButton1Click:Connect(function()
  786.    
  787.     switchWindow("Main")
  788.  
  789. end)
  790.  
  791. toggleInformation.MouseButton1Click:Connect(function()
  792.    
  793.     switchWindow("Information")
  794.    
  795. end)
  796.  
  797. closeInformation.MouseButton1Click:Connect(function()
  798.    
  799.     switchWindow("Main")
  800.  
  801. end)
  802.  
  803. closeMain.MouseButton1Click:Connect(function()
  804.  
  805.     switchWindow("None")
  806.    
  807. end)
  808.  
  809. openMain.MouseButton1Click:Connect(function()
  810.    
  811.     if mainFrame.Visible == true or mainFrame.Position == UDim2.new(0.5, 0, 1.5, 0) and activeWindow ~= "None" then
  812.        
  813.         switchWindow("None")
  814.        
  815.     else
  816.        
  817.         switchWindow("Main")
  818.        
  819.     end
  820.    
  821. end)
  822.  
  823. buyItem.MouseButton1Click:Connect(function()
  824.  
  825.     if itemInput.Text ~= "" and itemInput.Text ~= nil then
  826.  
  827.         local itemInfo = nil
  828.  
  829.         local success, error = pcall(function()
  830.  
  831.             itemInfo = marketPlaceService:GetProductInfo(tonumber(itemInput.Text), Enum.InfoType.Asset)
  832.  
  833.         end)
  834.  
  835.         if itemInfo == nil then return end
  836.  
  837.         if itemInfo["IsForSale"] == false then
  838.  
  839.             createNotif("Item Not For Sale", "Error")
  840.             return
  841.  
  842.         end
  843.  
  844.         if itemInfo["CanBeSoldInThisGame"] == false and itemInfo["Creator"]["CreatorTargetId"] ~= 1 then
  845.  
  846.             createNotif("Unable To Sell In This Experience", "Error")
  847.             return
  848.  
  849.         end
  850.  
  851.         if itemInfo["Remaining"] then
  852.  
  853.             if itemInfo["Remaining"] == 0 then
  854.  
  855.                 createNotif("Item Out Of Stock", "Error")
  856.                 return
  857.  
  858.             end
  859.  
  860.         end
  861.  
  862.         local success, error = pcall(function()
  863.  
  864.             buyItemEvent:FireServer({itemType = "Accessory", id = tonumber(itemInput.Text)})
  865.  
  866.         end)
  867.  
  868.     end
  869.  
  870. end)
  871.  
  872. buyBundle.MouseButton1Click:Connect(function()
  873.  
  874.     if bundleInput.Text ~= "" and bundleInput.Text ~= nil then
  875.  
  876.         local success, error = pcall(function()
  877.  
  878.             buyItemEvent:FireServer({itemType = "Bundle", id = tonumber(bundleInput.Text)})
  879.  
  880.         end)
  881.  
  882.     end
  883.  
  884. end)
  885.  
  886. buyPass.MouseButton1Click:Connect(function()
  887.  
  888.     if passInput.Text ~= "" and passInput.Text ~= nil then
  889.  
  890.         local success, error = pcall(function()
  891.  
  892.             buyItemEvent:FireServer({itemType = "Gamepass", id = tonumber(passInput.Text)})
  893.  
  894.         end)
  895.  
  896.     end
  897.  
  898. end)
  899.  
  900. tabFrames.Sniper.AddAccessory.MouseButton1Click:Connect(function()
  901.  
  902.     local inputBox = tabFrames.Sniper.AccessoryInput.Input
  903.  
  904.     if inputBox.Text ~= "" and inputBox.Text ~= nil then
  905.  
  906.         if not tabFrames.Sniper.CurrentSnipeFrame:FindFirstChild(inputBox.Text) then
  907.            
  908.             local message, newData = sniperFunction:InvokeServer({Action = "Add", id = inputBox.Text})
  909.  
  910.             createNotif(message["message"], message["messageType"])
  911.  
  912.             if message["message"] == "Success" then
  913.                
  914.                 updateSniper(newData["Sniper"])
  915.  
  916.             end
  917.            
  918.         else
  919.            
  920.             createNotif("Item Already Added", "Error")
  921.            
  922.         end
  923.  
  924.     end
  925.  
  926. end)
  927.  
  928. tabFrames.Sniper.ClearSniper.MouseButton1Click:Connect(function()
  929.    
  930.     local message, newData = sniperFunction:InvokeServer({Action = "Clear"})
  931.    
  932.     for _, connection in pairs(sniperConnections) do
  933.  
  934.         if type(connection) ~= "string" then
  935.  
  936.             connection:Disconnect()
  937.             connection = nil
  938.  
  939.         end
  940.  
  941.     end
  942.    
  943.     sniperConnections = {}
  944.    
  945.     task.delay(0.25, function()
  946.        
  947.         sniperData = newData["Sniper"]
  948.        
  949.         createNotif(message["message"], message["messageType"])
  950.         updateSniper(sniperData)
  951.        
  952.     end)
  953.    
  954. end)
  955.  
  956. logService.MessageOut:Connect(function(message: string, messageType: Enum.MessageType)
  957.    
  958.     if message:match("AllowThirdPartySales has blocked") then
  959.        
  960.         createNotif("Please Enable Third Party Sales", "Warn")
  961.        
  962.     end
  963.    
  964. end)
  965.  
  966. script.Parent:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
  967.    
  968.     updateSniperLayout()
  969.    
  970. end)
  971.  
  972. task.spawn(function()
  973.  
  974.     while task.wait() do
  975.        
  976.         local function colourItem(newColour: Color3)
  977.            
  978.             if rainbowMode then
  979.  
  980.                 for _, descendant in pairs(script.Parent:GetDescendants()) do
  981.  
  982.                     if descendant:GetAttribute("Theme") then
  983.  
  984.                         if descendant:IsA("ScrollingFrame") then
  985.  
  986.                             tweenService:Create(descendant, TweenInfo.new(0.25), { ScrollBarImageColor3 = newColour }):Play()
  987.  
  988.                         else
  989.  
  990.                             tweenService:Create(descendant, TweenInfo.new(0.5), { BackgroundColor3 = newColour }):Play()
  991.  
  992.                         end
  993.  
  994.                     end
  995.  
  996.                 end
  997.  
  998.             end
  999.            
  1000.         end
  1001.        
  1002.         colourItem(Color3.new(255 / 255, 0 / 255, 0 / 255))
  1003.        
  1004.         for i = 0, 255 , 10 do
  1005.            
  1006.             task.wait(0.05)
  1007.            
  1008.             colourItem(Color3.new(255 / 255, i / 255, 0 / 255))
  1009.            
  1010.         end
  1011.        
  1012.         for i = 255,0,-10 do
  1013.            
  1014.             task.wait(0.05)
  1015.            
  1016.             colourItem(Color3.new(i / 255, 255 / 255, 0 / 255))
  1017.            
  1018.         end
  1019.        
  1020.         for i = 0,255,10 do
  1021.            
  1022.             task.wait(0.05)
  1023.            
  1024.             colourItem(Color3.new(0 / 255, 255 / 255, i / 255))
  1025.            
  1026.         end
  1027.        
  1028.         for i = 255,0,-10 do
  1029.            
  1030.             task.wait(0.05)
  1031.            
  1032.             colourItem(Color3.new(0 / 255, i / 255, 255 / 255))
  1033.            
  1034.         end
  1035.        
  1036.         for i = 0,255,10 do
  1037.            
  1038.             task.wait(0.05)
  1039.            
  1040.             colourItem(Color3.new(i / 255, 0 / 255, 255 / 255))
  1041.            
  1042.         end
  1043.        
  1044.         for i = 255,0,-10 do
  1045.            
  1046.             task.wait(0.05)
  1047.            
  1048.             colourItem(Color3.new(255 / 255, 0 / 255, i / 255))
  1049.            
  1050.         end
  1051.  
  1052.     end
  1053.  
  1054. end)
  1055.  
  1056. repeat task.wait() until players.LocalPlayer.UserId
  1057.  
  1058. if players.LocalPlayer.UserId == game.CreatorId then
  1059.    
  1060.     players.LocalPlayer:Kick("\nPlease publish this experience under a group for it to work.\nThank you for choosing the model!")
  1061.    
  1062. end
  1063.  
  1064. switchTabs("Accessories")
  1065.  
  1066. task.wait(2.5)
  1067.  
  1068. settingsData = settingsFunction:InvokeServer({Action = "Get"})
  1069.  
  1070. updateSniper(settingsData["Sniper"])
  1071. changeColourScheme(color3Colour(settingsData["Colour"]))
  1072. changeMode(settingsData["Mode"])
  1073. toggleRetry.ButtonText.Text = "Retry: " .. (settingsData["Retry"] and "On" or "Off")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement