Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local marketPlaceService = game:GetService("MarketplaceService")
- local runService = game:GetService("RunService")
- local lighting = game:GetService("Lighting")
- local logService = game:GetService("LogService")
- local replicatedStorage = game:GetService("ReplicatedStorage")
- local teleportService = game:GetService("TeleportService")
- local tweenService = game:GetService("TweenService")
- local players = game:GetService("Players")
- local textColours = {
- Success = Color3.fromRGB(93, 255, 98),
- Error = Color3.fromRGB(255, 103, 103),
- Warn = Color3.fromRGB(255, 241, 85)
- }
- local mainFrame = script.Parent.MainFrame
- local settingsFrame = script.Parent.SettingsFrame
- local informationFrame = script.Parent.InformationFrame
- local notifList = script.Parent.Notifications
- local hoverText = script.Parent.HoverText
- local toggleTabs = mainFrame:WaitForChild("ToggleTabs")
- local toggleInformation, closeInformation = mainFrame:WaitForChild("ToggleInformation"), informationFrame:WaitForChild("Close")
- local toggleSettings, closeSettings = mainFrame:WaitForChild("ToggleSettings"), settingsFrame:WaitForChild("Close")
- local closeMain, openMain = mainFrame:WaitForChild("Close"), script.Parent:WaitForChild("Open")
- local tabFrames = mainFrame:WaitForChild("Tabs")
- local tabButtons = mainFrame:WaitForChild("TabButtons")
- local templates = replicatedStorage:WaitForChild("UITemplates")
- local notifText = templates.NotificationText
- local buyItemEvent = replicatedStorage.Events.BuyItem
- local sniperFunction = replicatedStorage.Functions.EditSniper
- local settingsFunction = replicatedStorage.Functions.ChangeSetting
- local buyItem, itemInput = tabFrames.Accessories.BuyItem, tabFrames.Accessories.InputFrame.Input
- local buyBundle, bundleInput = tabFrames.Bundles.BuyBundle, tabFrames.Bundles.InputFrame.Input
- local buyPass, passInput = tabFrames.Passes.BuyPass, tabFrames.Passes.InputFrame.Input
- local toggleRetry = tabFrames.Sniper.ToggleRetry
- local colourScheme = settingsFrame.ColourScheme
- local modeFrame = settingsFrame.Mode
- local sniperConnections = {}
- local sniperData = {}
- local rainbowMode = false
- local loadingSniper = false
- local switchingTabs = false
- local switchingColour = false
- local switchingMode = false
- local switchingWindow = false
- local activeWindow = "None"
- local activeTab = ""
- function playSound(soundName: string)
- replicatedStorage.Sounds:FindFirstChild(soundName):Play()
- end
- function assetOnsale(assetId)
- local assetData = marketPlaceService:GetProductInfo(assetId, Enum.InfoType.Asset)
- return assetData["IsForSale"]
- end
- function color3Colour(colour: string)
- if colour == "RGB" then
- return colour
- end
- local colourData = colour:split(", ")
- return Color3.fromRGB(tonumber(colourData[1]), tonumber(colourData[2]), tonumber(colourData[3]))
- end
- function updateSniperLayout()
- tabFrames.Sniper.CurrentSnipeFrame.CanvasSize = UDim2.new(0, 0, 0, tabFrames.Sniper.CurrentSnipeFrame.UIListLayout.AbsoluteContentSize.Y + 150)
- tabFrames.Sniper.CurrentSnipeFrame.UIListLayout.Padding = UDim.new(0, math.floor((script.Parent.AbsoluteSize.Y / 160) + 0.5))
- local newSize = (tabFrames.Sniper.CurrentSnipeFrame.AbsoluteSize.X - tabFrames.Sniper.CurrentSnipeFrame.ScrollBarThickness) * 0.95
- local newCellSize = UDim2.new(0, newSize, 0, newSize * 0.35)
- for _, item in pairs(tabFrames.Sniper.CurrentSnipeFrame:GetChildren()) do
- if item:IsA("Frame") then
- item.Size = newCellSize
- item.Visible = true
- end
- end
- end
- function updateSniper(snipeData)
- if loadingSniper == false then
- loadingSniper = true
- for _, item in pairs(tabFrames.Sniper.CurrentSnipeFrame:GetChildren()) do
- if item:IsA("Frame") then
- local success, error = pcall(function()
- sniperConnections[item.Name]:Disconnect()
- sniperConnections[item.Name] = nil
- end)
- item:Destroy()
- end
- end
- if snipeData ~= {} then
- for index, newData in pairs(snipeData) do
- local assetId = newData["itemId"]
- local retry = newData["retry"]
- local uuid = newData["uuid"]
- local newFrame = templates.TemplateFrame:Clone()
- newFrame.Name = assetId
- newFrame.LayoutOrder = index
- local itemData
- local success, error = pcall(function()
- itemData = marketPlaceService:GetProductInfo(assetId, Enum.InfoType.Asset)
- end)
- newFrame.ItemIcon.Image = "https://www.roblox.com/asset-thumbnail/image?assetId=" .. assetId .. "&width=420&height=420&format=png"
- newFrame.ItemName.Text = itemData["Name"]
- newFrame.Retry.Text = "Retry: " .. (retry and "On" or "Off")
- newFrame.Parent = tabFrames.Sniper.CurrentSnipeFrame
- task.spawn(function()
- sniperConnections[tostring(assetId)] = runService.Stepped:Connect(function()
- if not assetOnsale(assetId) then
- newFrame.Tries.Text = (tonumber(newFrame.Tries.Text) + 1)
- else
- local success, error = pcall(function()
- sniperConnections[tostring(assetId)]:Disconnect()
- sniperConnections[tostring(assetId)] = uuid
- end)
- playSound("SniperReleased")
- buyItemEvent:FireServer({itemType = "Accessory", id = assetId})
- marketPlaceService.PromptPurchaseFinished:Connect(function(player, newAssetId)
- if assetId == newAssetId then
- if uuid == sniperConnections[tostring(assetId)] then
- if retry and sniperConnections[tostring(assetId)] ~= nil then
- buyItemEvent:FireServer({itemType = "Accessory", id = assetId})
- else
- local message, newData = sniperFunction:InvokeServer({Action = "Remove", id = tonumber(newFrame.Name)})
- newFrame:Destroy()
- end
- end
- end
- end)
- end
- end)
- end)
- newFrame:FindFirstChild("Remove").MouseButton1Click:Connect(function()
- local message, newData = sniperFunction:InvokeServer({Action = "Remove", id = tonumber(newFrame.Name)})
- createNotif(message["message"], message["messageType"])
- if message["message"] == "Success" then
- if sniperConnections[tostring(assetId)] ~= nil then
- if type(sniperConnections[tostring(assetId)]) ~= "string" then
- sniperConnections[tostring(assetId)]:Disconnect()
- end
- sniperConnections[tostring(assetId)] = nil
- end
- updateSniper(newData["Sniper"])
- end
- end)
- updateSniperLayout()
- end
- loadingSniper = false
- end
- else
- createNotif("Sniper Loading", "Error")
- end
- end
- function createNotif(text: string, notifType: string)
- if #notifList:GetChildren() < 5 then
- local newText = notifText:Clone()
- newText.Text = text
- newText.TextColor3 = textColours[notifType]
- newText.Size = UDim2.new(0.95, 0, 0, 0)
- newText.Visible = true
- newText.Parent = notifList
- if notifType == "Success" then
- playSound("Success")
- else
- playSound("Error")
- end
- tweenService:Create(newText, TweenInfo.new(0.25, Enum.EasingStyle.Back), { Size = UDim2.new(0.95, 0, 0.593, 0) }):Play()
- task.delay(5, function()
- tweenService:Create(newText, TweenInfo.new(0.15), { Size = UDim2.new(0.95, 0, 0, 0) }):Play()
- task.wait(0.15)
- newText:Destroy()
- end)
- end
- end
- function changeMode(newMode: string)
- if switchingMode == false and modeFrame:FindFirstChild(newMode).Check.Visible == false then
- switchingMode = true
- task.delay(0.5, function()
- switchingMode = false
- end)
- for _, item in pairs(modeFrame:GetChildren()) do
- if item:IsA("ImageButton") then
- if item.Name == newMode then
- item.Check.ImageTransparency = 1
- item.Check.Visible = true
- tweenService:Create(item.Check, TweenInfo.new(0.5), { ImageTransparency = 0.1 }):Play()
- else
- task.delay(0.5, function()
- item.Check.Visible = false
- end)
- tweenService:Create(item.Check, TweenInfo.new(0.5), { ImageTransparency = 1 }):Play()
- end
- end
- end
- if newMode == "Light" and script.Parent:GetAttribute("Mode") == "Dark" then
- script.Parent:SetAttribute("Mode", "Light")
- modeFrame.Dark.Check.Visible = false
- mainFrame:FindFirstChild("DarkMode"):Destroy()
- settingsFrame:FindFirstChild("DarkMode"):Destroy()
- informationFrame:FindFirstChild("DarkMode"):Destroy()
- local newGradient01, newGradient02, newGradient03 = templates.Gradients.LightMode:Clone(), templates.Gradients.LightMode:Clone(), templates.Gradients.LightMode:Clone()
- newGradient01.Parent = mainFrame
- newGradient02.Parent = settingsFrame
- newGradient03.Parent = informationFrame
- templates.TemplateFrame.BackgroundColor3 = Color3.fromRGB(158, 158, 158)
- for _, item in pairs(tabFrames.Sniper.CurrentSnipeFrame:GetChildren()) do
- if item:IsA("Frame") then
- item.BackgroundColor3 = Color3.fromRGB(158, 158, 158)
- end
- end
- tweenService:Create(mainFrame, TweenInfo.new(0.5), { BackgroundColor3 = Color3.fromRGB(255, 255, 255) }):Play()
- tweenService:Create(settingsFrame, TweenInfo.new(0.5), { BackgroundColor3 = Color3.fromRGB(255, 255, 255) }):Play()
- tweenService:Create(informationFrame, TweenInfo.new(0.5), { BackgroundColor3 = Color3.fromRGB(255, 255, 255) }):Play()
- tweenService:Create(mainFrame.Title, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(0, 0, 0) }):Play()
- tweenService:Create(settingsFrame.Title, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(0, 0, 0) }):Play()
- tweenService:Create(informationFrame.Title, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(0, 0, 0) }):Play()
- tweenService:Create(informationFrame.InformationText, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(0, 0, 0) }):Play()
- tweenService:Create(informationFrame.InformationText2, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(0, 0, 0) }):Play()
- tweenService:Create(informationFrame.DonationText, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(0, 0, 0) }):Play()
- tweenService:Create(mainFrame.Watermark, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(0, 0, 0) }):Play()
- tweenService:Create(settingsFrame.ColourScheme.SettingTitle, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(0, 0, 0) }):Play()
- tweenService:Create(mainFrame.Tabs.Sniper.SniperText, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(0, 0, 0) }):Play()
- tweenService:Create(mainFrame.Tabs.Sniper.CurrentSnipeText, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(0, 0, 0) }):Play()
- tweenService:Create(mainFrame.ToggleTabs, TweenInfo.new(0.5), { ImageColor3 = Color3.fromRGB(0, 0, 0) }):Play()
- tweenService:Create(mainFrame.ToggleSettings, TweenInfo.new(0.5), { ImageColor3 = Color3.fromRGB(0, 0, 0) }):Play()
- tweenService:Create(mainFrame.ToggleInformation, TweenInfo.new(0.5), { ImageColor3 = Color3.fromRGB(0, 0, 0) }):Play()
- elseif newMode == "Dark" and script.Parent:GetAttribute("Mode") == "Light" then
- script.Parent:SetAttribute("Mode", "Dark")
- mainFrame:FindFirstChild("LightMode"):Destroy()
- settingsFrame:FindFirstChild("LightMode"):Destroy()
- informationFrame:FindFirstChild("LightMode"):Destroy()
- local newGradient01, newGradient02, newGradient03 = templates.Gradients.DarkMode:Clone(), templates.Gradients.DarkMode:Clone(), templates.Gradients.DarkMode:Clone()
- newGradient01.Parent = mainFrame
- newGradient02.Parent = settingsFrame
- newGradient03.Parent = informationFrame
- templates.TemplateFrame.BackgroundColor3 = Color3.fromRGB(31, 31, 31)
- for _, item in pairs(tabFrames.Sniper.CurrentSnipeFrame:GetChildren()) do
- if item:IsA("Frame") then
- item.BackgroundColor3 = Color3.fromRGB(31, 31, 31)
- end
- end
- tweenService:Create(mainFrame, TweenInfo.new(0.5), { BackgroundColor3 = Color3.fromRGB(20, 20, 20) }):Play()
- tweenService:Create(settingsFrame, TweenInfo.new(0.5), { BackgroundColor3 = Color3.fromRGB(20, 20, 20) }):Play()
- tweenService:Create(informationFrame, TweenInfo.new(0.5), { BackgroundColor3 = Color3.fromRGB(20, 20, 20) }):Play()
- tweenService:Create(mainFrame.Title, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(255, 255, 255) }):Play()
- tweenService:Create(settingsFrame.Title, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(255, 255, 255) }):Play()
- tweenService:Create(informationFrame.Title, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(255, 255, 255) }):Play()
- tweenService:Create(informationFrame.InformationText, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(255, 255, 255) }):Play()
- tweenService:Create(informationFrame.InformationText2, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(255, 255, 255) }):Play()
- tweenService:Create(informationFrame.DonationText, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(255, 255, 255) }):Play()
- tweenService:Create(mainFrame.Watermark, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(255, 255, 255) }):Play()
- tweenService:Create(settingsFrame.ColourScheme.SettingTitle, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(255, 255, 255) }):Play()
- tweenService:Create(mainFrame.Tabs.Sniper.SniperText, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(255, 255, 255) }):Play()
- tweenService:Create(mainFrame.Tabs.Sniper.CurrentSnipeText, TweenInfo.new(0.5), { TextColor3 = Color3.fromRGB(255, 255, 255) }):Play()
- tweenService:Create(mainFrame.ToggleTabs, TweenInfo.new(0.5), { ImageColor3 = Color3.fromRGB(255, 255, 255) }):Play()
- tweenService:Create(mainFrame.ToggleSettings, TweenInfo.new(0.5), { ImageColor3 = Color3.fromRGB(255, 255, 255) }):Play()
- tweenService:Create(mainFrame.ToggleInformation, TweenInfo.new(0.5), { ImageColor3 = Color3.fromRGB(255, 255, 255) }):Play()
- end
- end
- end
- function changeColourScheme(newColour: Color3)
- if switchingColour == false then
- switchingColour = true
- task.delay(0.5, function()
- switchingColour = false
- end)
- if newColour == "RGB" then
- rainbowMode = true
- else
- rainbowMode = false
- for _, descendant in pairs(script.Parent:GetDescendants()) do
- if descendant:GetAttribute("Theme") then
- if descendant:IsA("ScrollingFrame") then
- tweenService:Create(descendant, TweenInfo.new(0.5), { ScrollBarImageColor3 = newColour }):Play()
- else
- tweenService:Create(descendant, TweenInfo.new(0.5), { BackgroundColor3 = newColour }):Play()
- end
- end
- end
- end
- for _, button in pairs(colourScheme.Colours:GetChildren()) do
- if button:IsA("ImageButton") then
- if button.BackgroundColor3 == newColour or button.Name == newColour then
- button.Check.ImageTransparency = 1
- button.Check.Visible = true
- tweenService:Create(button.Check, TweenInfo.new(0.5), { ImageTransparency = 0.1 }):Play()
- else
- task.delay(0.5, function()
- button.Check.Visible = false
- end)
- tweenService:Create(button.Check, TweenInfo.new(0.5), { ImageTransparency = 1 }):Play()
- end
- end
- end
- end
- end
- function switchTabs(tabName: string)
- if switchingTabs == false and activeTab ~= tabName then
- switchingTabs = true
- activeTab = tabName
- task.delay(0.8, function()
- switchingTabs = false
- end)
- for _, frame in pairs(tabFrames:GetChildren()) do
- if frame:IsA("Frame") then
- if frame.Visible == true then
- tweenService:Create(frame, TweenInfo.new(0.75, Enum.EasingStyle.Back), { Position = UDim2.new(frame.Position.X.Scale, 0, -0.75, 0) }):Play()
- task.delay(0.8, function()
- frame.Visible = false
- frame.Position = UDim2.new(frame.Position.X.Scale, 0, 1.5, 0)
- end)
- end
- tweenService:Create(tabButtons:FindFirstChild(frame.Name).UIGradient, TweenInfo.new(0.5), { Offset = Vector2.new(-0.5, 0) }):Play()
- end
- end
- tabFrames:FindFirstChild(tabName).Visible = true
- 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()
- tweenService:Create(tabButtons:FindFirstChild(tabName).UIGradient, TweenInfo.new(0.5), { Offset = Vector2.new(0, 0) }):Play()
- end
- end
- function switchWindow(windowName: string)
- if switchingWindow ~= true and activeWindow ~= windowName then
- local availableWindows = {informationFrame, mainFrame, settingsFrame}
- switchingWindow = true
- activeWindow = windowName
- task.delay(0.8, function()
- switchingWindow = false
- end)
- if windowName == "None" then
- task.delay(0.25, function()
- lighting.DiscountBlur.Enabled = false
- lighting.DiscountColor.Enabled = false
- end)
- tweenService:Create(lighting.DiscountBlur, TweenInfo.new(0.25), { Size = 0 }):Play()
- tweenService:Create(lighting.DiscountColor, TweenInfo.new(0.25), { Brightness = 0 }):Play()
- tweenService:Create(lighting.DiscountColor, TweenInfo.new(0.25), { Saturation = 0 }):Play()
- for _, newWindow in pairs(availableWindows) do
- if newWindow.Visible == true then
- tweenService:Create(newWindow, TweenInfo.new(0.75, Enum.EasingStyle.Back), { Position = UDim2.new(0.5, 0, -0.5, 0) }):Play()
- task.delay(0.8, function()
- newWindow.Visible = false
- newWindow.Position = UDim2.new(0.5, 0, 1.5, 0)
- end)
- end
- end
- else
- lighting.DiscountBlur.Enabled = true
- lighting.DiscountColor.Enabled = true
- tweenService:Create(lighting.DiscountBlur, TweenInfo.new(0.25), { Size = 24 }):Play()
- tweenService:Create(lighting.DiscountColor, TweenInfo.new(0.25), { Brightness = -0.25 }):Play()
- tweenService:Create(lighting.DiscountColor, TweenInfo.new(0.25), { Saturation = -0.5 }):Play()
- for _, newWindow in pairs(availableWindows) do
- if newWindow.Visible == true then
- tweenService:Create(newWindow, TweenInfo.new(0.75, Enum.EasingStyle.Back), { Position = UDim2.new(0.5, 0, -0.5, 0) }):Play()
- task.delay(0.8, function()
- newWindow.Visible = false
- newWindow.Position = UDim2.new(0.5, 0, 1.5, 0)
- end)
- end
- end
- local newFrame = script.Parent:FindFirstChild(windowName .. "Frame")
- newFrame.Visible = true
- tweenService:Create(newFrame, TweenInfo.new(0.75, Enum.EasingStyle.Back), { Position = UDim2.new(0.5, 0, 0.5, 0) }):Play()
- end
- end
- end
- for _, button in pairs(script.Parent:GetDescendants()) do
- if button:IsA("ImageButton") then
- button.MouseEnter:Connect(function()
- playSound("Hover")
- end)
- button.MouseButton1Click:Connect(function()
- playSound("Click")
- end)
- end
- end
- for _, button in pairs(tabButtons:GetChildren()) do
- if button:IsA("ImageButton") then
- button.MouseButton1Click:Connect(function()
- switchTabs(button.Name)
- end)
- end
- end
- toggleTabs.MouseButton1Click:Connect(function()
- if switchingTabs == false then
- toggleTabs:SetAttribute("Toggled", not toggleTabs:GetAttribute("Toggled"))
- if toggleTabs:GetAttribute("Toggled") then
- for _, frame in pairs(tabFrames:GetChildren()) do
- if frame:IsA("Frame") then
- tweenService:Create(frame, TweenInfo.new(0.55, Enum.EasingStyle.Back), { Position = UDim2.new(0.633, 0, frame.Position.Y.Scale, 0) }):Play()
- end
- end
- tweenService:Create(tabButtons, TweenInfo.new(0.5, Enum.EasingStyle.Back), { Position = UDim2.new(0, 0, 0.43, 0) }):Play()
- else
- for _, frame in pairs(tabFrames:GetChildren()) do
- if frame:IsA("Frame") then
- tweenService:Create(frame, TweenInfo.new(0.55, Enum.EasingStyle.Back), { Position = UDim2.new(0.5, 0, frame.Position.Y.Scale, 0) }):Play()
- end
- end
- tweenService:Create(tabButtons, TweenInfo.new(0.5, Enum.EasingStyle.Back), { Position = UDim2.new(-0.3, 0, 0.43, 0) }):Play()
- end
- end
- end)
- informationFrame.GetModel.MouseButton1Click:Connect(function()
- marketPlaceService:PromptPurchase(players.LocalPlayer, 15202854806)
- end)
- informationFrame.Donate.MouseButton1Click:Connect(function()
- teleportService:Teleport(6972275856, players.LocalPlayer)
- end)
- for _, button in pairs(colourScheme.Colours:GetChildren()) do
- if button:IsA("ImageButton") then
- button.MouseButton1Click:Connect(function()
- if not button.Check.Visible then
- if button.Name == "RGB" then
- local message, newData = settingsFunction:InvokeServer({Action = "ChangeColour", Value = "RGB"})
- createNotif(message["message"], message["messageType"])
- changeColourScheme(color3Colour(newData["Colour"]))
- else
- local message, newData = settingsFunction:InvokeServer({Action = "ChangeColour", Value = button.BackgroundColor3})
- createNotif(message["message"], message["messageType"])
- changeColourScheme(color3Colour(newData["Colour"]))
- end
- else
- createNotif("Colour Already Selected", "Error")
- end
- end)
- end
- end
- for _, button in pairs(modeFrame:GetChildren()) do
- if button:IsA("ImageButton") then
- button.MouseButton1Click:Connect(function()
- if not button.Check.Visible then
- local message, newData = settingsFunction:InvokeServer({Action = "ChangeMode", Value = button.Name})
- createNotif(message["message"], message["messageType"])
- changeMode(newData["Mode"])
- else
- createNotif("Mode Already Selected", "Error")
- end
- end)
- end
- end
- toggleRetry.MouseButton1Click:Connect(function()
- local message, newData = settingsFunction:InvokeServer({Action = "ToggleRetry"})
- toggleRetry.ButtonText.Text = "Retry: " .. (newData["Retry"] and "On" or "Off")
- createNotif(message["message"], message["messageType"])
- end)
- toggleSettings.MouseButton1Click:Connect(function()
- switchWindow("Settings")
- end)
- closeSettings.MouseButton1Click:Connect(function()
- switchWindow("Main")
- end)
- toggleInformation.MouseButton1Click:Connect(function()
- switchWindow("Information")
- end)
- closeInformation.MouseButton1Click:Connect(function()
- switchWindow("Main")
- end)
- closeMain.MouseButton1Click:Connect(function()
- switchWindow("None")
- end)
- openMain.MouseButton1Click:Connect(function()
- if mainFrame.Visible == true or mainFrame.Position == UDim2.new(0.5, 0, 1.5, 0) and activeWindow ~= "None" then
- switchWindow("None")
- else
- switchWindow("Main")
- end
- end)
- buyItem.MouseButton1Click:Connect(function()
- if itemInput.Text ~= "" and itemInput.Text ~= nil then
- local itemInfo = nil
- local success, error = pcall(function()
- itemInfo = marketPlaceService:GetProductInfo(tonumber(itemInput.Text), Enum.InfoType.Asset)
- end)
- if itemInfo == nil then return end
- if itemInfo["IsForSale"] == false then
- createNotif("Item Not For Sale", "Error")
- return
- end
- if itemInfo["CanBeSoldInThisGame"] == false and itemInfo["Creator"]["CreatorTargetId"] ~= 1 then
- createNotif("Unable To Sell In This Experience", "Error")
- return
- end
- if itemInfo["Remaining"] then
- if itemInfo["Remaining"] == 0 then
- createNotif("Item Out Of Stock", "Error")
- return
- end
- end
- local success, error = pcall(function()
- buyItemEvent:FireServer({itemType = "Accessory", id = tonumber(itemInput.Text)})
- end)
- end
- end)
- buyBundle.MouseButton1Click:Connect(function()
- if bundleInput.Text ~= "" and bundleInput.Text ~= nil then
- local success, error = pcall(function()
- buyItemEvent:FireServer({itemType = "Bundle", id = tonumber(bundleInput.Text)})
- end)
- end
- end)
- buyPass.MouseButton1Click:Connect(function()
- if passInput.Text ~= "" and passInput.Text ~= nil then
- local success, error = pcall(function()
- buyItemEvent:FireServer({itemType = "Gamepass", id = tonumber(passInput.Text)})
- end)
- end
- end)
- tabFrames.Sniper.AddAccessory.MouseButton1Click:Connect(function()
- local inputBox = tabFrames.Sniper.AccessoryInput.Input
- if inputBox.Text ~= "" and inputBox.Text ~= nil then
- if not tabFrames.Sniper.CurrentSnipeFrame:FindFirstChild(inputBox.Text) then
- local message, newData = sniperFunction:InvokeServer({Action = "Add", id = inputBox.Text})
- createNotif(message["message"], message["messageType"])
- if message["message"] == "Success" then
- updateSniper(newData["Sniper"])
- end
- else
- createNotif("Item Already Added", "Error")
- end
- end
- end)
- tabFrames.Sniper.ClearSniper.MouseButton1Click:Connect(function()
- local message, newData = sniperFunction:InvokeServer({Action = "Clear"})
- for _, connection in pairs(sniperConnections) do
- if type(connection) ~= "string" then
- connection:Disconnect()
- connection = nil
- end
- end
- sniperConnections = {}
- task.delay(0.25, function()
- sniperData = newData["Sniper"]
- createNotif(message["message"], message["messageType"])
- updateSniper(sniperData)
- end)
- end)
- logService.MessageOut:Connect(function(message: string, messageType: Enum.MessageType)
- if message:match("AllowThirdPartySales has blocked") then
- createNotif("Please Enable Third Party Sales", "Warn")
- end
- end)
- script.Parent:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
- updateSniperLayout()
- end)
- task.spawn(function()
- while task.wait() do
- local function colourItem(newColour: Color3)
- if rainbowMode then
- for _, descendant in pairs(script.Parent:GetDescendants()) do
- if descendant:GetAttribute("Theme") then
- if descendant:IsA("ScrollingFrame") then
- tweenService:Create(descendant, TweenInfo.new(0.25), { ScrollBarImageColor3 = newColour }):Play()
- else
- tweenService:Create(descendant, TweenInfo.new(0.5), { BackgroundColor3 = newColour }):Play()
- end
- end
- end
- end
- end
- colourItem(Color3.new(255 / 255, 0 / 255, 0 / 255))
- for i = 0, 255 , 10 do
- task.wait(0.05)
- colourItem(Color3.new(255 / 255, i / 255, 0 / 255))
- end
- for i = 255,0,-10 do
- task.wait(0.05)
- colourItem(Color3.new(i / 255, 255 / 255, 0 / 255))
- end
- for i = 0,255,10 do
- task.wait(0.05)
- colourItem(Color3.new(0 / 255, 255 / 255, i / 255))
- end
- for i = 255,0,-10 do
- task.wait(0.05)
- colourItem(Color3.new(0 / 255, i / 255, 255 / 255))
- end
- for i = 0,255,10 do
- task.wait(0.05)
- colourItem(Color3.new(i / 255, 0 / 255, 255 / 255))
- end
- for i = 255,0,-10 do
- task.wait(0.05)
- colourItem(Color3.new(255 / 255, 0 / 255, i / 255))
- end
- end
- end)
- repeat task.wait() until players.LocalPlayer.UserId
- if players.LocalPlayer.UserId == game.CreatorId then
- players.LocalPlayer:Kick("\nPlease publish this experience under a group for it to work.\nThank you for choosing the model!")
- end
- switchTabs("Accessories")
- task.wait(2.5)
- settingsData = settingsFunction:InvokeServer({Action = "Get"})
- updateSniper(settingsData["Sniper"])
- changeColourScheme(color3Colour(settingsData["Colour"]))
- changeMode(settingsData["Mode"])
- toggleRetry.ButtonText.Text = "Retry: " .. (settingsData["Retry"] and "On" or "Off")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement