Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Synapse Decompiler
- -- Purchase Here: https://brack4712.xyz/synapse/purchase/
- local MP = game:GetService("MarketplaceService")
- local US = game:GetService("UserInputService")
- local Plr = game.Players.LocalPlayer
- local PlrGui = Plr:WaitForChild("PlayerGui")
- local Scrn = PlrGui:WaitForChild("Screen")
- local IntroG = PlrGui:WaitForChild("Intro")
- game.ReplicatedStorage:WaitForChild("DealershipGUI"):Clone().Parent = PlrGui
- PlrGui.DealershipGUI.Name = "Dealership"
- local DealershipGUI = PlrGui.Dealership
- local SettingsGUI = PlrGui:WaitForChild("Settings")
- local VehicleMenu = PlrGui:WaitForChild("VehicleMenu")
- local rE = game.ReplicatedStorage:WaitForChild("rE")
- local rF = game.ReplicatedStorage:WaitForChild("rF")
- local Cam = game.Workspace.CurrentCamera
- local color = Color3.fromRGB(90, 170, 78)
- local ButtonHover = false
- local MobileUser = false
- local PreviousGamepasses = {
- 232021112,
- 377032235,
- 285012955,
- 384451107,
- 304047750
- }
- local Gpasses = {
- 654740173,
- 654742252,
- 654744979,
- 654747899,
- 654750284,
- 654760268,
- 654762870,
- 654763207,
- 654763707,
- 654766320
- }
- local MoneyProducts = {
- 51345019,
- 51345087,
- 51345124,
- 51345196,
- 51345232,
- 51345298,
- 51345315,
- 51345398,
- 51345462,
- 51345544,
- 51345593,
- 51345649,
- 51345694,
- 51345732,
- 51345812,
- 51345904,
- 51345929,
- 51345978
- }
- local Rounder = require(game.ReplicatedStorage:WaitForChild("Rounder"))
- local SF = PlrGui:WaitForChild("SoundEffects")
- local LStats = Plr:WaitForChild("leaderstats")
- local HalfFade = false
- local BScrn2Loaded = false
- local BScrn = Scrn.BlackScreen
- delay(5, function()
- repeat
- wait()
- until Plr.Character:FindFirstChild("Head")
- if not BScrn2Loaded or Plr.Character.Head.CollisionGroupId == 0 then
- rE.RefreshCharacter:FireServer()
- end
- end)
- local BScrn2 = DealershipGUI:WaitForChild("BlackScreen")
- BScrn2Loaded = true
- if game.Workspace.CarCollection:FindFirstChild(Plr.Name) then
- rE.Delete:FireServer(game.Workspace.CarCollection:FindFirstChild(Plr.Name))
- end
- function MultiplyValues()
- for _, Folder in pairs(game.ReplicatedStorage.VehicleInformation:GetChildren()) do
- Folder.Value.Value = Rounder:RoundOff(Folder.StandardValue.Value * (1 + LStats.Tokens.Value / 2))
- end
- end
- if LStats.Tokens.Value > 0 then
- MultiplyValues()
- end
- if workspace:FindFirstChild("Garage") then
- workspace.Garage:Destroy()
- end
- if workspace:FindFirstChild("Dealership") then
- workspace.Dealership:Destroy()
- end
- if Plr:FindFirstChild("MobileUser") then
- MobileUser = true
- elseif US.AccelerometerEnabled then
- rE.CreateInstance:FireServer("MobileUser")
- MobileUser = true
- end
- local VMenuPos1, VMenuPos2
- if MobileUser then
- US.ModalEnabled = false
- VehicleMenu.Menu:Destroy()
- VehicleMenu.MobileMenu.Name = "Menu"
- VMenuPos2 = UDim2.new(-2.5, 0, 0, -4)
- VMenuPos1 = UDim2.new(-2.5, 0, -2, 0)
- SettingsGUI.Settings.Background.Description.Visible = false
- else
- VehicleMenu.MobileMenu:Destroy()
- VMenuPos2 = UDim2.new(-3.2, 0, -5.5, 0)
- VMenuPos1 = UDim2.new(0, 0, -5.5, 0)
- end
- game.Lighting.ColorCorrection.Brightness = 0
- rE.GamepassItem:FireServer("Invincibility")
- game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
- Cam.CameraSubject = Plr.Character:WaitForChild("Humanoid")
- Cam.CameraType = "Custom"
- Plr.CameraMode = "Classic"
- Plr.CameraMaxZoomDistance = 250
- Scrn.BlackScreen.Text = ""
- function BtnClickAnim(Button)
- local OriginalUDim
- Button.down.Visible = true
- Button.ImageTransparency = 1
- if Button:FindFirstChild("ImageLabel") then
- OriginalUDim = Button.ImageLabel.Position
- Button.ImageLabel.Position = OriginalUDim + UDim2.new(0, 0, 0.09, 0)
- elseif Button:FindFirstChild("TextLabel") then
- OriginalUDim = Button.TextLabel.Position
- Button.TextLabel.Position = OriginalUDim + UDim2.new(0, 0, 0.09, 0)
- elseif Button:FindFirstChild("LockImage") then
- OriginalUDim = Button.LockImage.Position
- Button.LockImage.Position = OriginalUDim + UDim2.new(0, 0, 0.09, 0)
- end
- SF.ButtonClick3D:Play()
- wait(0.1)
- Button.down.Visible = false
- Button.ImageTransparency = 0
- if Button:FindFirstChild("ImageLabel") then
- Button.ImageLabel.Position = OriginalUDim
- elseif Button:FindFirstChild("TextLabel") then
- Button.TextLabel.Position = OriginalUDim
- elseif Button:FindFirstChild("LockImage") then
- Button.LockImage.Position = OriginalUDim
- end
- end
- function BScrnOut()
- for T = BScrn.Transparency, 1.05, 0.1 do
- BScrn.BackgroundTransparency = T
- wait()
- end
- BScrn.Visible = false
- end
- function BScrnIn()
- BScrn.Visible = true
- if not HalfFade then
- for T = BScrn.Transparency, -0.05, -0.1 do
- BScrn.BackgroundTransparency = T
- wait()
- end
- else
- for T = BScrn.Transparency, 0.49, -0.1 do
- BScrn.BackgroundTransparency = T
- wait()
- end
- end
- wait(0.5)
- end
- function BScrnOut2()
- for T = BScrn2.Transparency, 0.51, 0.1 do
- BScrn2.BackgroundTransparency = T
- wait()
- end
- BScrn2.Visible = false
- end
- function BScrnIn2()
- BScrn2.Visible = true
- for T = BScrn2.Transparency, 0.49, -0.1 do
- BScrn2.BackgroundTransparency = T
- wait()
- end
- end
- local PartVal = Plr:WaitForChild("Parts")
- local CCovers = game.Workspace:WaitForChild("CrusherCovers")
- local L1, L2, L3, L4, MC, VL, PL, EC = false, false, false, false, false, false, false, false
- local B1, B2, B3 = false, false, false
- if CCovers:FindFirstChild("Line1") then
- L1 = CCovers.Line1
- end
- if CCovers:FindFirstChild("Line2") then
- L2 = CCovers.Line2
- end
- if CCovers:FindFirstChild("Line3") then
- L3 = CCovers.Line3
- end
- if CCovers:FindFirstChild("Line4") then
- L4 = CCovers.Line4
- end
- if CCovers:FindFirstChild("Middle") then
- MC = CCovers.Middle
- end
- if CCovers:FindFirstChild("VipLine") then
- VL = CCovers.VipLine
- end
- if CCovers:FindFirstChild("PremiumLine") then
- PL = CCovers.PremiumLine
- end
- if CCovers:FindFirstChild("EnergyCore") then
- EC = CCovers.EnergyCore
- end
- function HideCovers(Val)
- if Val >= 10000 and L1 then
- L1:Destroy()
- L1 = false
- end
- if Val >= 25000 and L2 then
- L2:Destroy()
- L2 = false
- end
- if Val >= 50000 and MC then
- MC:Destroy()
- MC = false
- end
- if Val >= 75000 and L3 then
- L3:Destroy()
- L3 = false
- end
- if Val >= 100000 and L4 then
- L4:Destroy()
- L4 = false
- end
- end
- if VL and (MP:PlayerOwnsAsset(Plr, 654750284) or MP:PlayerOwnsAsset(Plr, 232021112)) then
- VL:Destroy()
- VL = false
- end
- if EC and (MP:PlayerOwnsAsset(Plr, 654763207) or MP:PlayerOwnsAsset(Plr, 285012955)) then
- EC:Destroy()
- EC = false
- end
- if PL and MP:PlayerOwnsAsset(Plr, 654762870) then
- PL:Destroy()
- PL = false
- end
- HideCovers(PartVal.Value)
- PartVal.Changed:connect(function(Val)
- HideCovers(Val)
- if not B1 and Val >= 25000 then
- rE.GiveBadge:FireServer(1)
- B1 = true
- end
- if not B2 and Val >= 100000 then
- rE.GiveBadge:FireServer(2)
- B2 = true
- end
- if not B3 and Val >= 250000 then
- rE.GiveBadge:FireServer(3)
- B3 = true
- end
- end)
- local Settings = Plr:WaitForChild("Settings")
- local Music = Plr:WaitForChild("MusicValue")
- local ChangingMusic = Plr:WaitForChild("ChangingMusic")
- local MeltDownActive = workspace.EnergyCore.ControlRoom.MeltDown
- local GuisHidden = workspace.EnergyCore.ControlRoom.GuisHidden
- Music.Value = 0
- ChangingMusic.Value = false
- SF.Song1:play()
- SF.Song3:play()
- Music.Changed:connect(function(val)
- if not Settings.MusicDisabled.Value and (not MeltDownActive.Value or val == 0) then
- if val == 0 then
- for i = 1, 10 do
- SF.Song1.Volume = SF.Song1.Volume - 0.05
- SF.Song2.Volume = SF.Song2.Volume - 0.04
- SF.Song3.Volume = SF.Song3.Volume - 0.03
- wait()
- end
- SF.Song1.Volume = 0
- SF.Song2.Volume = 0
- SF.Song3.Volume = 0
- SF.Song2:stop()
- elseif val == 1 then
- for i = 1, 10 do
- SF.Song1.Volume = SF.Song1.Volume + 0.05
- wait()
- end
- SF.Song1.Volume = 0.5
- elseif val == 2 then
- SF.Song2:play()
- for i = 1, 10 do
- SF.Song2.Volume = SF.Song2.Volume + 0.04
- wait()
- end
- SF.Song2.Volume = 0.4
- elseif val == 3 then
- for i = 1, 10 do
- SF.Song3.Volume = SF.Song3.Volume + 0.05
- wait()
- end
- SF.Song3.Volume = 0.3
- end
- end
- end)
- Sensors = game.Workspace:WaitForChild("CenterPoints"):WaitForChild("Sensors")
- repeat
- wait()
- until Plr.Character:FindFirstChild("Head")
- Plr.Character.Head.Touched:connect(function(part)
- if part.Name == "Enable" and part.Parent == Sensors then
- if ChangingMusic.Value then
- repeat
- wait()
- until not ChangingMusic.Value
- end
- if Music.Value == 0 then
- ChangingMusic.Value = true
- Music.Value = 1
- wait(0.3)
- ChangingMusic.Value = false
- end
- elseif part.Name == "Disable" and part.Parent == Sensors then
- ChangingMusic.Value = true
- Music.Value = 0
- wait(0.3)
- ChangingMusic.Value = false
- end
- end)
- local NewPlayer = Plr:WaitForChild("NewPlayer")
- local SFrame = Scrn:WaitForChild("Gamepasses"):WaitForChild("Background"):WaitForChild("ScrollingFrame")
- local CustScroll = DealershipGUI.Customize.Background.ScrollingFrame
- local ShowGP = 5
- if NewPlayer.Value then
- if not MP:PlayerOwnsAsset(Plr, 232021112) then
- SFrame:WaitForChild("Vip"):Destroy()
- ShowGP = ShowGP - 1
- end
- if not MP:PlayerOwnsAsset(Plr, 377032235) then
- SFrame:WaitForChild("Crowbar"):Destroy()
- ShowGP = ShowGP - 1
- end
- if not MP:PlayerOwnsAsset(Plr, 285012955) then
- SFrame:WaitForChild("EnergyCore"):Destroy()
- ShowGP = ShowGP - 1
- end
- if not MP:PlayerOwnsAsset(Plr, 384451107) then
- SFrame:WaitForChild("Invincibility"):Destroy()
- ShowGP = ShowGP - 1
- end
- if not MP:PlayerOwnsAsset(Plr, 304047750) then
- SFrame:WaitForChild("Admin"):Destroy()
- ShowGP = ShowGP - 1
- end
- end
- spawn(function()
- if MP:PlayerOwnsAsset(Plr, Gpasses[1]) then
- for _, BuyColor in pairs(CustScroll:GetChildren()) do
- if BuyColor.Name == "PremiumColor" then
- BuyColor.LockImage.Visible = false
- end
- end
- end
- if MP:PlayerOwnsAsset(Plr, Gpasses[3]) then
- CustScroll.Neon.LockImage.Visible = false
- end
- if MP:PlayerOwnsAsset(Plr, Gpasses[4]) then
- CustScroll.Silver.LockImage.Visible = false
- end
- if MP:PlayerOwnsAsset(Plr, Gpasses[9]) or MP:PlayerOwnsAsset(Plr, 304047750) then
- CustScroll.Gold.LockImage.Visible = false
- end
- if MP:PlayerOwnsAsset(Plr, Gpasses[10]) then
- CustScroll.Platinum.LockImage.Visible = false
- end
- end)
- local DealershipModel = game.ReplicatedStorage:WaitForChild("Dealership"):Clone()
- local GarageModel = game.ReplicatedStorage:WaitForChild("Garage"):Clone()
- local VList = require(game.ReplicatedStorage:WaitForChild("VehicleOrder"))
- local TBar = Scrn:WaitForChild("Topbar")
- local Progress = TBar.Holder.Progress
- local DTbar = DealershipGUI:WaitForChild("TopBar")
- local ScrnStats = TBar:WaitForChild("Holder"):WaitForChild("stats")
- local DsStats = DTbar:WaitForChild("Stats"):WaitForChild("Holder"):WaitForChild("stats")
- local Menu = TBar:WaitForChild("Holder"):WaitForChild("menu")
- local Tutorial = Scrn:WaitForChild("Tutorial"):WaitForChild("BackGround"):WaitForChild("Frame")
- local AnimationActive = false
- local TPHover = false
- ScrnStats.Money.Text = "Money: " .. Rounder:ConvertLong(math.floor(Plr.Money.Value))
- ScrnStats.Parts.Text = "Parts: " .. Rounder:FormatNumber(Plr.Parts.Value)
- DsStats.Money.Text = "Money: " .. Rounder:ConvertLong(math.floor(Plr.Money.Value))
- DsStats.Tokens.Text = "Tokens: " .. LStats.Tokens.Value .. "/3"
- local MessagePos1, MessagePos2
- local OldMoney = math.floor(Plr.Money.Value)
- local OldParts = Plr.Parts.Value
- local OldTokens = LStats.Tokens.Value
- local Activations1 = 0
- local Activations2 = 0
- local Activations3 = 0
- local IncomeDebounce1 = false
- local IncomeDebounce2 = false
- local IncomeDebounce3 = false
- local B4, B5, B6 = false, false, false
- Plr.Money.Changed:connect(function()
- ScrnStats.Money.Text = "Money: " .. Rounder:ConvertLong(math.floor(Plr.Money.Value))
- DsStats.Money.Text = ScrnStats.Money.Text
- if not IncomeDebounce1 then
- IncomeDebounce1 = true
- local Change = math.floor(Plr.Money.Value) - OldMoney
- if Change ~= 0 then
- Activations1 = Activations1 + 1
- if Change < 0 then
- ScrnStats.MoneyIncome.TextColor3 = Color3.fromRGB(212, 50, 50)
- DsStats.MoneyIncome.TextColor3 = Color3.fromRGB(212, 50, 50)
- ScrnStats.MoneyIncome.TextStrokeColor3 = Color3.fromRGB(70, 0, 0)
- DsStats.MoneyIncome.TextStrokeColor3 = Color3.fromRGB(70, 0, 0)
- ScrnStats.MoneyIncome.Text = "-" .. Rounder:ConvertLong(Change)
- else
- ScrnStats.MoneyIncome.TextColor3 = color
- DsStats.MoneyIncome.TextColor3 = color
- ScrnStats.MoneyIncome.TextStrokeColor3 = Color3.fromRGB(37, 70, 31)
- DsStats.MoneyIncome.TextStrokeColor3 = Color3.fromRGB(37, 70, 31)
- ScrnStats.MoneyIncome.Text = "+" .. Rounder:ConvertLong(Change)
- end
- DsStats.MoneyIncome.Text = ScrnStats.MoneyIncome.Text
- ScrnStats.MoneyIncome.Visible = true
- DsStats.MoneyIncome.Visible = true
- ScrnStats.MoneyIncome.Rotation = math.random(150, 250) / 10
- DsStats.MoneyIncome.Rotation = math.random(150, 250) / 10
- IncomeDebounce1 = false
- wait(0.2)
- ScrnStats.MoneyIncome.Rotation = 0
- DsStats.MoneyIncome.Rotation = 0
- wait(5)
- Activations1 = Activations1 - 1
- if Activations1 == 0 then
- IncomeDebounce1 = true
- for i = 1, 10 do
- ScrnStats.MoneyIncome.TextTransparency = ScrnStats.MoneyIncome.TextTransparency + 0.1
- DsStats.MoneyIncome.TextTransparency = DsStats.MoneyIncome.TextTransparency + 0.1
- wait()
- end
- ScrnStats.MoneyIncome.Visible = false
- DsStats.MoneyIncome.Visible = false
- ScrnStats.MoneyIncome.TextTransparency = 0
- DsStats.MoneyIncome.TextTransparency = 0
- OldMoney = math.floor(Plr.Money.Value)
- IncomeDebounce1 = false
- end
- else
- IncomeDebounce1 = false
- end
- end
- if not B4 and Plr.Money.Value >= 1000000 then
- rE.GiveBadge:FireServer(4)
- B4 = true
- end
- if not B5 and Plr.Money.Value >= 1000000000 then
- rE.GiveBadge:FireServer(5)
- B5 = true
- end
- if not B6 and Plr.Money.Value >= 1000000000000 then
- rE.GiveBadge:FireServer(6)
- B6 = true
- end
- end)
- Plr.Parts.Changed:connect(function()
- ScrnStats.Parts.Text = "Parts: " .. Rounder:FormatNumber(Plr.Parts.Value)
- if not IncomeDebounce2 then
- IncomeDebounce2 = true
- local Change = Plr.Parts.Value - OldParts
- Activations2 = Activations2 + 1
- ScrnStats.PartsIncome.Text = "+" .. Rounder:ConvertLong(Change)
- ScrnStats.PartsIncome.Visible = true
- ScrnStats.PartsIncome.Rotation = math.random(150, 250) / 10
- IncomeDebounce2 = false
- wait(0.2)
- ScrnStats.PartsIncome.Rotation = 0
- wait(5)
- Activations2 = Activations2 - 1
- if Activations2 == 0 then
- IncomeDebounce2 = true
- for i = 1, 10 do
- ScrnStats.PartsIncome.TextTransparency = ScrnStats.PartsIncome.TextTransparency + 0.1
- wait()
- end
- ScrnStats.PartsIncome.Visible = false
- ScrnStats.PartsIncome.TextTransparency = 0
- OldParts = Plr.Parts.Value
- IncomeDebounce2 = false
- end
- end
- end)
- LStats.Tokens.Changed:connect(function()
- DsStats.Tokens.Text = "Tokens: " .. LStats.Tokens.Value .. "/3"
- if not IncomeDebounce3 then
- IncomeDebounce3 = true
- local Change = LStats.Tokens.Value - OldTokens
- Activations3 = Activations3 + 1
- DsStats.TokenIncome.Text = "+" .. Rounder:ConvertLong(Change)
- DsStats.TokenIncome.Visible = true
- DsStats.TokenIncome.Rotation = math.random(150, 250) / 10
- IncomeDebounce3 = false
- wait(0.2)
- DsStats.TokenIncome.Rotation = 0
- wait(5)
- Activations3 = Activations3 - 1
- if Activations3 == 0 then
- IncomeDebounce3 = true
- for i = 1, 10 do
- DsStats.TokenIncome.TextTransparency = DsStats.TokenIncome.TextTransparency + 0.1
- wait()
- end
- DsStats.TokenIncome.Visible = false
- DsStats.TokenIncome.TextTransparency = 0
- OldTokens = LStats.Tokens.Value
- IncomeDebounce3 = false
- end
- end
- end)
- function ArrangeGUIs()
- Scrn.Topbar.Position = UDim2.new(0.5, -Scrn.Topbar.AbsoluteSize.X / 2, 0, 0)
- Scrn.Gamepasses.Position = UDim2.new(0.5, -Scrn.Gamepasses.AbsoluteSize.X / 2, 0, 0)
- Scrn.Tutorial.Position = UDim2.new(0.5, -Scrn.Tutorial.AbsoluteSize.X / 2, 0, 0)
- Scrn.Message.Position = UDim2.new(0.5, -Scrn.Message.AbsoluteSize.X / 2, Scrn.Message.Position.Y.Scale, Scrn.Message.Position.Y.Offset)
- MessagePos1 = UDim2.new(0.5, -Scrn.Message.AbsoluteSize.X / 2, 1, -Scrn.Message.AbsoluteSize.Y)
- MessagePos2 = UDim2.new(0.5, -Scrn.Message.AbsoluteSize.X / 2, 0.99, -(Scrn.Message.AbsoluteSize.Y + DealershipGUI.BottomBar.Holder.Spawn.AbsoluteSize.Y))
- DealershipGUI.List.Position = UDim2.new(0.5, -DealershipGUI.List.AbsoluteSize.X / 2, 0, 0)
- DealershipGUI.BottomBar.Position = UDim2.new(0.5, -DealershipGUI.BottomBar.AbsoluteSize.X / 2, 1, 0)
- DealershipGUI.JoinGroup.Position = UDim2.new(0.5, -DealershipGUI.JoinGroup.AbsoluteSize.X / 2, 0, 0)
- SettingsGUI.ConfirmQuality.Position = UDim2.new(0.5, -SettingsGUI.ConfirmQuality.AbsoluteSize.X / 2, 0, 0)
- SettingsGUI.ConfirmTransfer.Position = UDim2.new(0.5, -SettingsGUI.ConfirmTransfer.AbsoluteSize.X / 2, 0, 0)
- SettingsGUI.Settings.Position = UDim2.new(0.5, -SettingsGUI.Settings.AbsoluteSize.X / 2, 0, 0)
- if MobileUser then
- VehicleMenu.Menu.Position = UDim2.new(0.5, -VehicleMenu.Menu.AbsoluteSize.X / 2, 1, 0)
- end
- end
- ArrangeGUIs()
- DealershipGUI.MeasureMent:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
- wait(0.1)
- ArrangeGUIs()
- end)
- function OpenTutorial()
- if MeltDownActive.Value then
- local Folder = Instance.new("Folder", Plr)
- Folder.Name = "ResumeTutorial"
- else
- SF.Swoosh.PlaybackSpeed = 1.3
- SF.Swoosh:play()
- Tutorial.Parent.Parent.Visible = true
- Tutorial.Parent:TweenPosition(UDim2.new(-3.5, 0, 0, (DealershipGUI.MeasureMent.AbsoluteSize.Y - Tutorial.Parent.AbsoluteSize.Y) / 2), "In", "Sine", 0.3, true)
- end
- end
- TBar.Visible = true
- if GuisHidden.Value then
- TBar.Holder.Position = UDim2.new(-2, 0, -1.79, 0)
- TBar.Holder.hide.Visible = false
- TBar.Holder.Progress.Visible = false
- end
- Music.Value = 1
- BScrnOut()
- if NewPlayer.Value then
- NewPlayer.Value = false
- local Val1 = Instance.new("BoolValue", Plr)
- Val1.Name = "Spin"
- local Val2 = Instance.new("BoolValue", Plr)
- Val2.Name = "Conveyor"
- local Val3 = Instance.new("BoolValue", Plr)
- Val3.Name = "Controls"
- wait(0.5)
- if ShowGP > 0 then
- AnimationActive = true
- SF.Swoosh.PlaybackSpeed = 1.3
- SF.Swoosh:play()
- SFrame.Parent.Parent.Visible = true
- SFrame.Parent:TweenPosition(UDim2.new(-3.5, 0, 0, (DealershipGUI.MeasureMent.AbsoluteSize.Y - SFrame.Parent.AbsoluteSize.Y) / 2), "In", "Sine", 0.3, false)
- wait(0.3)
- AnimationActive = false
- else
- OpenTutorial()
- end
- end
- if Plr:FindFirstChild("ResumeTutorial") then
- Plr.ResumeTutorial:Destroy()
- OpenTutorial()
- end
- local RecentlyTeleported = false
- Menu.Teleport.MouseButton1Click:connect(function()
- BtnClickAnim(Menu.Teleport)
- if not RecentlyTeleported and not AnimationActive then
- AnimationActive = true
- delay(5, function()
- RecentlyTeleported = false
- if TPHover then
- Menu.Teleport.ImageColor3 = Menu.Teleport.HoverColor.Value
- Menu.Teleport.down.ImageColor3 = Menu.Teleport.HoverColor.Value
- else
- Menu.Teleport.ImageColor3 = color
- Menu.Teleport.down.ImageColor3 = color
- end
- end)
- local Changing = false
- if Music.Value == 3 or Music.Value == 0 then
- repeat
- wait()
- until not ChangingMusic.Value
- Music.Value = 0
- ChangingMusic.Value = true
- Changing = true
- end
- BScrnIn()
- RecentlyTeleported = true
- if TPHover then
- Menu.Teleport.ImageColor3 = Menu.Teleport.DisabledColorHover.Value
- Menu.Teleport.down.ImageColor3 = Menu.Teleport.DisabledColorHover.Value
- else
- Menu.Teleport.ImageColor3 = Menu.Teleport.DisabledColor.Value
- Menu.Teleport.down.ImageColor3 = Menu.Teleport.DisabledColor.Value
- end
- rE.TeleportPlr:FireServer("LobbySpawn")
- if Changing then
- Music.Value = 1
- end
- BScrnOut()
- if Changing then
- ChangingMusic.Value = false
- end
- AnimationActive = false
- end
- end)
- Menu.Teleport.MouseEnter:connect(function()
- if RecentlyTeleported then
- Menu.Teleport.ImageColor3 = Menu.Teleport.DisabledColorHover.Value
- Menu.Teleport.down.ImageColor3 = Menu.Teleport.DisabledColorHover.Value
- else
- Menu.Teleport.ImageColor3 = Menu.Teleport.HoverColor.Value
- Menu.Teleport.down.ImageColor3 = Menu.Teleport.HoverColor.Value
- end
- if not TPHover then
- TPHover = true
- SF.ButtonHover:Play()
- end
- Menu.Teleport.MouseLeave:connect(function()
- if RecentlyTeleported then
- Menu.Teleport.ImageColor3 = Menu.Teleport.DisabledColor.Value
- Menu.Teleport.down.ImageColor3 = Menu.Teleport.DisabledColor.Value
- else
- Menu.Teleport.ImageColor3 = color
- Menu.Teleport.down.ImageColor3 = color
- end
- TPHover = false
- end)
- end)
- local HideFrame = TBar.Holder:WaitForChild("hide")
- local TBarHidden = false
- local LoadingGamepasses = true
- HideFrame:WaitForChild("ClickBox").MouseButton1Click:connect(function()
- if not AnimationActive then
- AnimationActive = true
- SF.ButtonClick2D:play()
- if TBarHidden then
- TBarHidden = false
- HideFrame.up.Visible = true
- HideFrame.down.Visible = false
- HideFrame.Parent.menu.Visible = true
- Progress.Visible = true
- HideFrame.Parent:TweenPosition(UDim2.new(-2, 0, 0.1, 0), "In", "Back", 0.3, true)
- wait(0.3)
- else
- TBarHidden = true
- HideFrame.up.Visible = false
- HideFrame.down.Visible = true
- HideFrame.Parent:TweenPosition(UDim2.new(-2, 0, -1.79, 0), "Out", "Back", 0.3, true)
- wait(0.2)
- HideFrame.Parent.menu.Visible = false
- Progress.Visible = false
- wait(0.1)
- end
- AnimationActive = false
- end
- end)
- local BaseUDim = UDim2.new(0, 0, 0.08, 0)
- for _, GUI in pairs(SFrame:GetChildren()) do
- if GUI:IsA("Frame") then
- GUI.Position = BaseUDim
- BaseUDim = BaseUDim + UDim2.new(0, 0, 0.16, 0)
- end
- end
- SFrame.Bottom.Position = BaseUDim
- SFrame.Parent.Button.MouseButton1Click:connect(function()
- BtnClickAnim(SFrame.Parent.Button)
- if not AnimationActive then
- AnimationActive = true
- SF.Swoosh.PlaybackSpeed = 1
- SF.Swoosh:play()
- SFrame.Parent:TweenPosition(UDim2.new(-3.5, 0, 0, DealershipGUI.MeasureMent.AbsoluteSize.Y), "Out", "Sine", 0.5, false)
- wait(0.5)
- SFrame.Parent.Parent.Visible = false
- ButtonHover = false
- AnimationActive = false
- wait(0.2)
- OpenTutorial()
- end
- end)
- SFrame.Parent.Button.MouseEnter:connect(function()
- if not ButtonHover then
- ButtonHover = true
- SFrame.Parent.Button.ImageColor3 = SFrame.Parent.Button.HoverColor.Value
- SFrame.Parent.Button.down.ImageColor3 = SFrame.Parent.Button.HoverColor.Value
- SF.ButtonHover:Play()
- end
- SFrame.Parent.Button.MouseLeave:connect(function()
- SFrame.Parent.Button.ImageColor3 = color
- SFrame.Parent.Button.down.ImageColor3 = color
- ButtonHover = false
- end)
- end)
- spawn(function()
- local LockTbl = rF.GiveGamepass:InvokeServer(Gpasses, PreviousGamepasses)
- LoadingGamepasses = false
- function LockButton(FrameName)
- PlrGui.GamepassShop.ScrollingFrame:FindFirstChild(FrameName).TextButton.BackgroundColor3 = PlrGui.GamepassShop.DisabledColor.Value
- PlrGui.GamepassShop.ScrollingFrame:FindFirstChild(FrameName).TextButton.AutoButtonColor = false
- PlrGui.GamepassShop.ScrollingFrame:FindFirstChild(FrameName).TextButton.Text = "Owned"
- end
- for _, v in pairs(LockTbl) do
- LockButton(v)
- end
- end)
- local P = Plr:WaitForChild("P")
- local StatsBack = DTbar.VehicleStats.Background
- local ListFrameBack = DealershipGUI.List.Background
- local SideBar = DTbar.SideBar
- local Holder = DealershipGUI.BottomBar.Holder
- local ReqG = Holder.Requirement
- local CustBtn = StatsBack.Customize
- local CExit = DealershipGUI.CustomizeExit.Exit
- local Grey = Holder.Next.ImageColor3
- local Blue = CustBtn.ImageColor3
- local Message = Scrn.Message
- local ShopOpen = false
- local ListOpen = false
- local Dealing = false
- local SpawnDisabled = false
- local SpawnDisabled2 = false
- local ScrollDebounce = false
- local CustomizationChange = false
- local CustDisabled = false
- local Fading = false
- local OpenVM = false
- local SettingsIsOpen = false
- local DTBarDisabled = false
- local VehicleAmount = #game.ReplicatedStorage.VehicleInformation:GetChildren()
- local View = 1
- local PrevSong = 0
- local CurrentCar = {}
- local StandardValue, VehicleCopy, CustomDataCache, InUseCar, Seat
- function GetCurrentCarValue()
- local Value
- for I in pairs(CurrentCar) do
- Value = I
- end
- return Value
- end
- function InfoTable(V)
- local t = {
- VipOnly = false,
- GroupOnly = false,
- ImageID = false,
- Price = false,
- Parts = false,
- Value = false
- }
- if V.VipOnly.Value == true then
- t.VipOnly = true
- end
- if V.GroupOnly.Value == true then
- t.GroupOnly = true
- end
- t.ImageID = V.ImageID.Value
- t.Price = V.Price.Value
- t.Parts = V.Parts.Value
- t.Value = V.Value.Value
- V = t
- return V
- end
- if 5 > #ListFrameBack.VehicleList:GetChildren() then
- print("run")
- local VehicleFrames = {}
- local Template = ListFrameBack.VehicleList:WaitForChild("Vehicle"):Clone()
- local Template2 = DealershipGUI.TopBar.VehicleBar.Vehicle:Clone()
- ListFrameBack.VehicleList.Vehicle:Destroy()
- DealershipGUI.TopBar.VehicleBar.Vehicle:Destroy()
- for Pos, CarN in pairs(VList) do
- local C = InfoTable(game.ReplicatedStorage.VehicleInformation:FindFirstChild(CarN))
- if C ~= nil then
- local New = Template:Clone()
- New.Name = CarN
- New.ImageButton.Image = "rbxassetid://" .. C.ImageID
- New.Color.P.Text = Rounder:ConvertAccurate(C.Price)
- New.Parts.Text = "Parts: " .. C.Parts
- New.Value.Text = "Value: " .. Rounder:ConvertAccurate(C.Value)
- New.P.Value = Pos
- New.LayoutOrder = Pos
- New.Parent = ListFrameBack.VehicleList
- table.insert(VehicleFrames, New)
- local New2 = Template2:Clone()
- New2.Name = CarN
- New2.ImageButton.Image = "rbxassetid://" .. C.ImageID
- New2.Color.P.Text = Rounder:ConvertAccurate(C.Price)
- New2.P.Value = Pos
- New2.LayoutOrder = Pos
- New2.Parent = DealershipGUI.TopBar.VehicleBar
- table.insert(VehicleFrames, New2)
- if C.VipOnly then
- New.Color.BackgroundColor3 = Color3.fromRGB(72, 43, 190)
- New2.Color.BackgroundColor3 = Color3.fromRGB(72, 43, 190)
- elseif C.GroupOnly then
- New.Color.BackgroundColor3 = Color3.fromRGB(37, 114, 190)
- New2.Color.BackgroundColor3 = Color3.fromRGB(37, 114, 190)
- end
- end
- end
- end
- function FillOutStats(V)
- local Vehicle = game.ReplicatedStorage.VehicleInformation:FindFirstChild(V)
- if Vehicle ~= nil then
- StatsBack.name.Text = Vehicle:FindFirstChild("Name").Value
- StatsBack.Price.Text = "Price: " .. Rounder:ConvertAccurate(Vehicle.Price.Value)
- StatsBack.Creator.Text = "Builder: " .. Vehicle.Creator.Value
- if Plr.Settings.SpeedUnit.Value == 1 then
- StatsBack.Speed.Text = "Speed: " .. math.floor(Vehicle.Speed.Value * 0.8333333333333334 * 0.6818181818181818) .. " MPH"
- else
- StatsBack.Speed.Text = "Speed: " .. math.floor(Vehicle.Speed.Value * 0.8333333333333334 * 1.09728) .. " KM/H"
- end
- StatsBack.Value.Text = "Value: " .. Rounder:ConvertAccurate(Vehicle.Value.Value)
- StatsBack.Parts.Text = "Parts: " .. Vehicle.Parts.Value
- if Vehicle.VipOnly.Value then
- StatsBack.TopBar.BackgroundColor3 = Color3.fromRGB(109, 61, 255)
- elseif Vehicle.GroupOnly.Value then
- StatsBack.TopBar.BackgroundColor3 = Color3.fromRGB(50, 150, 255)
- else
- StatsBack.TopBar.BackgroundColor3 = color
- end
- end
- Vehicle = nil
- end
- function LockDSButtons()
- Holder.Spawn.ImageColor3 = Holder.Spawn.DisabledColor.Value
- Holder.Spawn.down.ImageColor3 = Holder.Spawn.DisabledColor.Value
- SpawnDisabled2 = true
- ReqG.Visible = true
- CustBtn.ImageColor3 = CustBtn.DisabledColor.Value
- CustBtn.down.ImageColor3 = CustBtn.DisabledColor.Value
- CustDisabled = true
- end
- function UpdateRequirements(V)
- local Result, Extra = rF.PurchVehicle:InvokeServer(V, false)
- if Result == "Owned" then
- if not SpawnDisabled then
- Holder.Spawn.ImageColor3 = color
- Holder.Spawn.down.ImageColor3 = color
- end
- CustBtn.ImageColor3 = Blue
- CustBtn.down.ImageColor3 = Blue
- CustDisabled = false
- ReqG.Visible = false
- SpawnDisabled2 = false
- elseif Result == "Low Tokens" then
- LockDSButtons()
- local N = game.ReplicatedStorage.VehicleInformation:FindFirstChild(GetCurrentCarValue().Name).TokenRequirement.Value
- if N == 1 then
- ReqG.Text = "Requires " .. N .. " token"
- else
- ReqG.Text = "Requires " .. N .. " tokens"
- end
- elseif Result == "Need VIP" then
- LockDSButtons()
- ReqG.Text = "Requires VIP"
- elseif Result == "Group" then
- LockDSButtons()
- ReqG.Text = "Join the group in the description to unlock this vehicle"
- elseif Result == "Low Cash" then
- LockDSButtons()
- ReqG.Text = "Not enough money"
- end
- end
- function ChangeVehicleProps(Vehicle, Color, Material, Reflectance, Value, DefaultValue, TextColor)
- pcall(function()
- if Material == "Standard" then
- local Folder = game.ReplicatedStorage.VehicleInformation:FindFirstChild(Vehicle.Name)
- Material = Folder.StandardMaterial.Value
- Reflectance = Folder.StandardReflectance.Value
- end
- for I, VehiclePart in pairs(Vehicle.Car.Body.Parts.Paint:GetChildren()) do
- if VehiclePart:IsA("BasePart") then
- VehiclePart.Material = Material
- VehiclePart.Reflectance = Reflectance
- if Color then
- VehiclePart.BrickColor = Color
- end
- end
- end
- for I, Model in pairs(Vehicle.Car.Wheels:GetChildren()) do
- for I, VehiclePart in pairs(Model:GetChildren()) do
- if VehiclePart:IsA("BasePart") and VehiclePart.Name == "Paint" then
- VehiclePart.Material = Material
- VehiclePart.Reflectance = Reflectance
- if Color then
- VehiclePart.BrickColor = Color
- end
- end
- end
- end
- if Value then
- Vehicle.Value.Value = Value
- Holder.Value.Text = "Value: " .. Rounder:ConvertAccurate(Value)
- Holder.Value.TextColor3 = TextColor
- Holder.DefaultValue.Text = "Default Value: " .. Rounder:ConvertAccurate(DefaultValue)
- if TextColor == Color3.new(1, 1, 1) then
- Holder.DefaultValue.TextColor3 = Color3.fromRGB(205, 205, 205)
- else
- Holder.DefaultValue.TextColor3 = TextColor
- end
- end
- end)
- end
- local ColorChanged = false
- function LoadCustomization(Vehicle)
- if game.ReplicatedStorage.VehicleInformation:FindFirstChild(Vehicle.Name) then
- local CustomData = rF.LoadSaveCustoms:InvokeServer("Load", nil, Vehicle.Name)
- if CustomData then
- ColorChanged = true
- CustomDataCache = CustomData
- local BC, BM = CustomData.BodyColor, CustomData.BodyMaterial
- local Folder = game.ReplicatedStorage.VehicleInformation:FindFirstChild(GetCurrentCarValue().Name)
- local NormalValue = Folder.StandardValue.Value
- StandardValue = Folder.Value.Value
- if BM == "Regular" then
- ChangeVehicleProps(Vehicle, BrickColor.new(BC), "Standard", "Standard")
- elseif BM == "Metal" then
- ChangeVehicleProps(Vehicle, BrickColor.new(BC), "Metal", 0)
- elseif BM == "Neon" then
- ChangeVehicleProps(Vehicle, BrickColor.new(BC), "Neon", 0)
- Vehicle.Value.Value = math.ceil(StandardValue + NormalValue * 0.25)
- elseif BM == "Silver" then
- if BC == "Pearl" then
- ColorChanged = false
- end
- ChangeVehicleProps(Vehicle, BrickColor.new(BC), "SmoothPlastic", 0.45)
- Vehicle.Value.Value = math.ceil(StandardValue + NormalValue * 0.5)
- elseif BM == "Gold" then
- if BC == "Bright yellow" then
- ColorChanged = false
- end
- ChangeVehicleProps(Vehicle, BrickColor.new(BC), "SmoothPlastic", 0.6)
- Vehicle.Value.Value = math.ceil(StandardValue + NormalValue * 1)
- elseif BM == "Platinum" then
- local Reflectance = 0.8
- if BC == "Institutional white" then
- Reflectance = 1
- ColorChanged = false
- end
- ChangeVehicleProps(Vehicle, BrickColor.new(BC), "SmoothPlastic", 0.8)
- Vehicle.Value.Value = math.ceil(StandardValue + NormalValue * 2)
- end
- elseif not CustomData then
- CustomDataCache = nil
- end
- end
- end
- function LoadVehicle(AssetID)
- return rF.InsertCar:InvokeServer(AssetID)
- end
- function SpawnPreview()
- local status = false
- delay(10, function()
- if status then
- error("SpawnPreview stopped at: " .. status)
- end
- end)
- if P.Value == 0 then
- P.Value = 1
- end
- status = "Clearing old models and Vehiclebar"
- if 1 <= #Cam:GetChildren() then
- rE.ClearModels:FireServer()
- end
- CurrentCar = {}
- local CarName = VList[P.Value]
- DTbar.VehicleBar.UIPageLayout:JumpTo(DTbar.VehicleBar:FindFirstChild(CarName))
- status = "Loading preview vehicle"
- CurrentCar[LoadVehicle(game.ReplicatedStorage.VehicleInformation:FindFirstChild(CarName).AssetID.Value)] = true
- status = "Adjusting car value"
- GetCurrentCarValue().Value.Value = game.ReplicatedStorage.VehicleInformation:FindFirstChild(CarName).Value.Value
- status = "Loading customization"
- LoadCustomization(GetCurrentCarValue())
- status = "Filling stats"
- FillOutStats(GetCurrentCarValue().Name)
- status = "Parenting and primarypart"
- if GetCurrentCarValue().PrimaryPart ~= nil then
- GetCurrentCarValue():SetPrimaryPartCFrame(DealershipModel.VehicleSpawn.CFrame)
- else
- rE.RefreshCharacter:FireServer()
- end
- GetCurrentCarValue().Parent = Cam
- status = "Update Requirements"
- UpdateRequirements(GetCurrentCarValue().Name)
- status = false
- end
- function SaveCustomizations()
- if CustomizationChange then
- local PAINT
- for _, v in pairs(GetCurrentCarValue().Car.Body.Parts.Paint:GetChildren()) do
- if v:IsA("BasePart") then
- PAINT = v
- break
- end
- end
- local CustomData = {
- BodyColor = PAINT.BrickColor.Name,
- BodyMaterial = PAINT.Material.Name
- }
- local Folder = game.ReplicatedStorage.VehicleInformation:FindFirstChild(GetCurrentCarValue().Name)
- if PAINT.Material.Name == Folder.StandardMaterial.Value and PAINT.Reflectance > Folder.StandardReflectance.Value - 0.01 and PAINT.Reflectance < Folder.StandardReflectance.Value + 0.01 then
- CustomData.BodyMaterial = "Regular"
- elseif PAINT.Material.Name == "Metal" then
- CustomData.BodyMaterial = "Metal"
- elseif PAINT.Material.Name == "Neon" then
- CustomData.BodyMaterial = "Neon"
- elseif PAINT.Material.Name == "SmoothPlastic" and PAINT.Reflectance > 0.44 and PAINT.Reflectance < 0.46 then
- CustomData.BodyMaterial = "Silver"
- elseif PAINT.Material.Name == "SmoothPlastic" and PAINT.Reflectance > 0.59 and PAINT.Reflectance < 0.61 then
- CustomData.BodyMaterial = "Gold"
- elseif PAINT.Material.Name == "SmoothPlastic" and PAINT.Reflectance > 0.79 and PAINT.Reflectance < 1.01 then
- CustomData.BodyMaterial = "Platinum"
- end
- rF.LoadSaveCustoms:InvokeServer("Save", CustomData, GetCurrentCarValue().Name)
- CustomDataCache = CustomData
- CustomizationChange = false
- CustomData = nil
- PAINT = nil
- end
- end
- function SeatAdded(child)
- if child:IsA("Weld") and child.Part1 and child.Part1.Name == "HumanoidRootPart" and game.Players:GetPlayerFromCharacter(child.Part1.Parent) == Plr then
- if View == 4 then
- wait(0.1)
- Cam.CameraSubject = workspace.Dealership.CameraFocus
- Cam.CFrame = workspace.Dealership.CameraFocus.CFrame
- if PlrGui:FindFirstChild("Interface") then
- PlrGui.Interface.Enabled = false
- end
- elseif View == 5 then
- wait(0.1)
- Cam.CameraSubject = workspace.Garage.CameraFocus
- Cam.CFrame = workspace.Garage.CameraFocus.CFrame
- if PlrGui:FindFirstChild("Interface") then
- PlrGui.Interface.Enabled = false
- end
- end
- end
- end
- function SeatRemoved(child)
- if child:IsA("Weld") and child.Part1 and child.Part1.Name == "HumanoidRootPart" and game.Players:GetPlayerFromCharacter(child.Part1.Parent) == Plr then
- if View == 2 then
- wait(0.1)
- Cam.CameraSubject = Seat
- Cam.CFrame = Seat.CFrame
- elseif View == 4 then
- wait(0.1)
- Cam.CameraSubject = workspace.Dealership.CameraFocus
- Cam.CFrame = workspace.Dealership.CameraFocus.CFrame
- elseif View == 5 then
- wait(0.1)
- Cam.CameraSubject = workspace.Garage.CameraFocus
- Cam.CFrame = workspace.Garage.CameraFocus.CFrame
- end
- end
- end
- function SeatTouched(part)
- if part.Name == "Enable" and part.Parent == Sensors and Seat.Music.Value == 0 then
- Seat.Music.Value = 1
- if PlrGui:FindFirstChild("Interface") then
- PlrGui.Interface.DamageEnabled.Value = true
- end
- elseif part.Name == "Disable" and part.Parent == Sensors and Seat.Music.Value == 1 then
- Seat.Music.Value = 0
- if PlrGui:FindFirstChild("Interface") then
- PlrGui.Interface.DamageEnabled.Value = false
- end
- end
- end
- Menu.Dealership.MouseButton1Click:connect(function()
- Fading = true
- BtnClickAnim(Menu.Dealership)
- repeat
- wait()
- until not ChangingMusic.Value
- PrevSong = Music.Value
- Music.Value = 0
- ChangingMusic.Value = true
- BScrnIn()
- local status = "Parenting preview rooms"
- delay(10, function()
- if status then
- error("Dealership enter loading stopped at: " .. status)
- end
- end)
- DealershipModel.Parent = game.Workspace
- GarageModel.Parent = game.Workspace
- status = "Adjusting GUI's"
- TBar.Visible = false
- Scrn.Tutorial.Visible = false
- Scrn.Gamepasses.Visible = false
- SettingsIsOpen = false
- SettingsGUI.Settings.Background.Position = UDim2.new(-3.5, 0, 0, DealershipGUI.MeasureMent.AbsoluteSize.Y)
- SettingsGUI.Settings.Visible = false
- DealershipGUI.BottomBar.Visible = true
- DealershipGUI.TopBar.Visible = true
- Menu.Dealership.ImageColor3 = color
- game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
- if MobileUser then
- US.ModalEnabled = true
- end
- ButtonHover = false
- status = "Adjusting Camera"
- Cam.CameraType = "Custom"
- Cam.CameraSubject = DealershipModel.CameraFocus
- Cam.CFrame = DealershipModel.CameraFocus.CFrame
- Plr.CameraMode = "Classic"
- Plr.CameraMaxZoomDistance = 25
- View = 4
- status = "Hiding extras"
- if VehicleMenu.Menu.Visible == true then
- VehicleMenu.Menu.Visible = false
- OpenVM = true
- else
- OpenVM = false
- end
- if PlrGui:FindFirstChild("Interface") then
- PlrGui.Interface.Enabled = false
- end
- if MeltDownActive.Value then
- Scrn.Message.Position = MessagePos2
- end
- status = "Spawning Preview"
- SpawnPreview()
- status = "Editing vehiclelist"
- local Owned = rF.GetOwned:InvokeServer()
- for _, vname in pairs(Owned) do
- if game.ReplicatedStorage.VehicleInformation:FindFirstChild(vname).VipOnly.Value == true then
- ListFrameBack.VehicleList:FindFirstChild(vname).Color.BackgroundColor3 = Color3.fromRGB(109, 61, 255)
- DTbar.VehicleBar:FindFirstChild(vname).Color.BackgroundColor3 = Color3.fromRGB(109, 61, 255)
- elseif game.ReplicatedStorage.VehicleInformation:FindFirstChild(vname).GroupOnly.Value == true then
- ListFrameBack.VehicleList:FindFirstChild(vname).Color.BackgroundColor3 = Color3.fromRGB(50, 150, 255)
- DTbar.VehicleBar:FindFirstChild(vname).Color.BackgroundColor3 = Color3.fromRGB(50, 150, 255)
- else
- ListFrameBack.VehicleList:FindFirstChild(vname).Color.BackgroundColor3 = color
- DTbar.VehicleBar:FindFirstChild(vname).Color.BackgroundColor3 = color
- end
- end
- for _, v in pairs(DealershipGUI.List.Background.VehicleList:GetChildren()) do
- local Vehicle = game.ReplicatedStorage.VehicleInformation:FindFirstChild(v.Name)
- if v:IsA("Frame") then
- if Plr.Settings.SpeedUnit.Value == 1 then
- v.Speed.Text = "Speed: " .. math.floor(Vehicle.Speed.Value * 0.8333333333333334 * 0.6818181818181818) .. " MPH"
- else
- v.Speed.Text = "Speed: " .. math.floor(Vehicle.Speed.Value * 0.8333333333333334 * 1.09728) .. " KM/H"
- end
- end
- end
- Music.Value = 2
- Dealing = true
- BScrnOut()
- status = false
- ChangingMusic.Value = false
- Fading = false
- Owned = nil
- end)
- Menu.Dealership.MouseEnter:connect(function()
- if not ButtonHover then
- ButtonHover = true
- Menu.Dealership.ImageColor3 = Menu.Dealership.HoverColor.Value
- Menu.Dealership.down.ImageColor3 = Menu.Dealership.HoverColor.Value
- SF.ButtonHover:Play()
- end
- Menu.Dealership.MouseLeave:connect(function()
- Menu.Dealership.ImageColor3 = color
- Menu.Dealership.down.ImageColor3 = color
- ButtonHover = false
- end)
- end)
- Holder.Next.MouseButton1Click:connect(function()
- if not ScrollDebounce then
- ScrollDebounce = true
- BtnClickAnim(Holder.Next)
- if P.Value < VehicleAmount then
- P.Value = P.Value + 1
- else
- P.Value = 0
- end
- SpawnPreview()
- ScrollDebounce = false
- end
- end)
- Holder.Next.MouseEnter:connect(function()
- if not ButtonHover then
- ButtonHover = true
- Holder.Next.ImageColor3 = Holder.Next.HoverColor.Value
- Holder.Next.down.ImageColor3 = Holder.Next.HoverColor.Value
- SF.ButtonHover:Play()
- end
- Holder.Next.MouseLeave:connect(function()
- Holder.Next.ImageColor3 = Grey
- Holder.Next.down.ImageColor3 = Grey
- ButtonHover = false
- end)
- end)
- Holder.Previous.MouseButton1Click:connect(function()
- if not ScrollDebounce then
- ScrollDebounce = true
- BtnClickAnim(Holder.Previous)
- if P.Value > 1 then
- P.Value = P.Value - 1
- else
- P.Value = VehicleAmount
- end
- SpawnPreview()
- ScrollDebounce = false
- end
- end)
- Holder.Previous.MouseEnter:connect(function()
- if not ButtonHover then
- ButtonHover = true
- Holder.Previous.ImageColor3 = Holder.Previous.HoverColor.Value
- Holder.Previous.down.ImageColor3 = Holder.Previous.HoverColor.Value
- SF.ButtonHover:Play()
- end
- Holder.Previous.MouseLeave:connect(function()
- Holder.Previous.ImageColor3 = Grey
- Holder.Previous.down.ImageColor3 = Grey
- ButtonHover = false
- end)
- end)
- function ButtonClick2D(Button)
- SF.ButtonClick2D:play()
- Button.BackgroundTransparency = 0.99
- Button.BackgroundColor3 = Color3.new(1, 1, 1)
- for i = 1, 3 do
- Button.BackgroundTransparency = Button.BackgroundTransparency - 0.03
- wait()
- end
- if ButtonHover then
- Button.BackgroundTransparency = 0.85
- else
- Button.BackgroundTransparency = 1
- end
- Button.BackgroundColor3 = Color3.new(0, 0, 0)
- end
- local VehicleHover = false
- local ChangeWait = 0
- local VehicleFrames = {}
- for _, v in pairs(ListFrameBack.VehicleList:GetChildren()) do
- if v:IsA("Frame") then
- table.insert(VehicleFrames, v)
- end
- end
- for _, v in pairs(DTbar.VehicleBar:GetChildren()) do
- if v:IsA("Frame") then
- table.insert(VehicleFrames, v)
- end
- end
- for _, v in pairs(VehicleFrames) do
- v.Click.MouseButton1Click:connect(function()
- ButtonClick2D(v.Click)
- if not ScrollDebounce then
- ScrollDebounce = true
- P.Value = v.P.Value
- SpawnPreview()
- ScrollDebounce = false
- end
- end)
- v.Click.MouseEnter:connect(function()
- if not VehicleHover then
- VehicleHover = true
- SF.ButtonHover:play()
- v.Click.BackgroundTransparency = 0.85
- FillOutStats(v.Name)
- end
- end)
- v.Click.MouseLeave:connect(function()
- v.Click.BackgroundTransparency = 1
- VehicleHover = false
- ChangeWait = ChangeWait + 1
- wait(0.5)
- ChangeWait = ChangeWait - 1
- if ChangeWait == 0 and not VehicleHover and not ScrollDebounce then
- FillOutStats(GetCurrentCarValue().Name)
- end
- end)
- end
- local G_Open = false
- Holder.Spawn.MouseButton1Click:connect(function()
- BtnClickAnim(Holder.Spawn)
- if not SpawnDisabled and not ScrollDebounce then
- ScrollDebounce = true
- local Result, Extra = rF.PurchVehicle:InvokeServer(GetCurrentCarValue().Name, false)
- if Result == "Need VIP" then
- MP:PromptPurchase(Plr, Gpasses[5])
- elseif Result == "Group" and not G_Open and not AnimationActive then
- G_Open = true
- AnimationActive = true
- DealershipGUI.JoinGroup.Visible = true
- SF.Swoosh.PlaybackSpeed = 1.3
- SF.Swoosh:play()
- DealershipGUI.JoinGroup.Background:TweenPosition(UDim2.new(-3.5, 0, 0, (DealershipGUI.MeasureMent.AbsoluteSize.Y - DealershipGUI.JoinGroup.Background.AbsoluteSize.Y) / 2), "In", "Sine", 0.3, false)
- wait(0.3)
- AnimationActive = false
- elseif Result == "Owned" then
- Fading = true
- Music.Value = 0
- ChangingMusic.Value = true
- BScrnIn()
- do
- local status = "Saving customizations"
- delay(10, function()
- if status then
- error("Spawn loading stopped at: " .. status)
- end
- end)
- Dealing = false
- SF.Spawn:Play()
- SaveCustomizations()
- status = "Copying vehicle"
- VehicleCopy = Cam:GetChildren()[1]:Clone()
- status = "Spawning event"
- local Parts = rF.SpawnVehicle:InvokeServer(VehicleCopy.Name, CustomDataCache)
- status = "CanCollide false"
- for _, v in pairs(Parts) do
- v.CanCollide = false
- end
- Parts = nil
- status = "Waiting for car"
- InUseCar = game.Workspace.CarCollection:WaitForChild(Plr.Name)
- status = "Assigning seat"
- Seat = InUseCar.Car.Body.VehicleSeat
- status = "Clearing old models"
- if #Cam:GetChildren() >= 1 then
- rE.ClearModels:FireServer()
- end
- CurrentCar = {}
- status = "Adjusting GUI's"
- CExit.Position = UDim2.new(0, 0, -1, 0)
- DealershipGUI.Customize.Background.Position = UDim2.new(-5, 0, 0, 0)
- DealershipGUI.Customize.ColorName.Position = UDim2.new(-5, 0, 8.945, 0)
- StatsBack.Position = UDim2.new(-0.1, 0, 0, 0)
- SideBar.Position = UDim2.new(1, 0, 1.08, 0)
- Holder.Previous.Position = UDim2.new(0, 0, 0, 0)
- Holder.Next.Position = UDim2.new(0.82, 0, 0, 0)
- Holder.Value.Position = UDim2.new(-0.5, 0, 0.25, 0)
- Holder.TokenBonus.Position = UDim2.new(-0.5, 0, 0.25, 0)
- Holder.DefaultValue.Position = UDim2.new(-0.5, 0, 0.25, 0)
- ListFrameBack.Position = UDim2.new(-5.1, 0, 0, DealershipGUI.MeasureMent.AbsoluteSize.Y)
- DealershipGUI.JoinGroup.Background.Position = UDim2.new(-3.5, 0, 0, DealershipGUI.MeasureMent.AbsoluteSize.Y)
- Holder.Spawn.ImageColor3 = color
- DTBarDisabled = false
- ButtonHover = false
- ShopOpen = false
- ListOpen = false
- G_Open = false
- DealershipGUI.CustomizeExit.Visible = false
- DealershipGUI.Customize.Visible = false
- DealershipGUI.TopBar.Visible = false
- DealershipGUI.BottomBar.Visible = false
- DealershipGUI.List.Visible = false
- DealershipGUI.JoinGroup.Visible = false
- TBar.Visible = true
- if MeltDownActive.Value and not MobileUser then
- Scrn.Message.Position = MessagePos1
- end
- game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
- if MobileUser then
- US.ModalEnabled = false
- end
- View = 1
- status = "Music value"
- local val = Instance.new("NumberValue")
- val.Parent = Seat
- val.Name = "Music"
- val.Value = 1
- status = "Seat connections"
- Seat.Touched:connect(SeatTouched)
- Seat.ChildAdded:connect(SeatAdded)
- Seat.ChildRemoved:connect(SeatRemoved)
- status = "Waiting"
- wait(0.5)
- status = "Teleporting player"
- rE.TeleportPlr:FireServer("VehicleSeat")
- status = "Changing Camera"
- Cam.CameraSubject = Plr.Character.Humanoid
- Cam.CameraType = "Custom"
- Plr.CameraMaxZoomDistance = 250
- status = "Vehicle menu"
- VehicleMenu.Menu.Visible = true
- VehicleMenu.Menu.Background.Hide.Hide.Visible = true
- VehicleMenu.Menu.Background.Hide.Show.Visible = false
- VehicleMenu.Menu.Background.Background.Teleport.ImageColor3 = color
- VehicleMenu.Menu.Background.Background.Teleport.down.ImageColor3 = color
- VehicleMenu.Menu.Background.Background.CameraLabel.Text = VehicleMenu.Menu.Background.Background.CameraLabel.DisabledText.Value
- VehicleMenu.Menu.Background.Position = VMenuPos1
- status = "Removing preview rooms"
- GarageModel.Parent = nil
- DealershipModel.Parent = nil
- Music.Value = 1
- BScrnOut()
- status = false
- ChangingMusic.Value = false
- Fading = false
- end
- end
- ScrollDebounce = false
- end
- end)
- Holder.Spawn.MouseEnter:connect(function()
- if not ButtonHover and not SpawnDisabled and not SpawnDisabled2 then
- ButtonHover = true
- Holder.Spawn.ImageColor3 = Holder.Spawn.HoverColor.Value
- Holder.Spawn.down.ImageColor3 = Holder.Spawn.HoverColor.Value
- SF.ButtonHover:Play()
- elseif not ButtonHover then
- ButtonHover = true
- Holder.Spawn.ImageColor3 = Holder.Spawn.DisabledColorHover.Value
- Holder.Spawn.down.ImageColor3 = Holder.Spawn.DisabledColorHover.Value
- SF.ButtonHover:Play()
- end
- Holder.Spawn.MouseLeave:connect(function()
- if not SpawnDisabled and not SpawnDisabled2 then
- Holder.Spawn.ImageColor3 = color
- Holder.Spawn.down.ImageColor3 = color
- ButtonHover = false
- else
- Holder.Spawn.ImageColor3 = Holder.Spawn.DisabledColor.Value
- Holder.Spawn.down.ImageColor3 = Holder.Spawn.DisabledColor.Value
- ButtonHover = false
- end
- end)
- end)
- local SoundDebounce = false
- function AddNotification(VehicleNum)
- local Stats = game.ReplicatedStorage.VehicleInformation:FindFirstChild(VList[VehicleNum])
- local Frame = Scrn.Notification:Clone()
- Frame.Vehicle.ImageButton.Image = "rbxassetid://" .. Stats.ImageID.Value
- if Stats.VipOnly.Value then
- Frame.Vehicle.Color.BackgroundColor3 = Color3.fromRGB(109, 61, 255)
- elseif Stats.GroupOnly.Value then
- Frame.Vehicle.Color.BackgroundColor3 = Color3.fromRGB(50, 150, 255)
- end
- Frame.Parent = Scrn.Notifications
- Frame.Visible = true
- P.Value = VehicleNum
- for _, v in pairs(Scrn.Notifications:GetChildren()) do
- v.Target.Value = v.Target.Value - 2.25
- v.Vehicle:TweenPosition(UDim2.new(-2.25, 0, v.Target.Value, 0), "In", "Sine", 0.3, true)
- end
- if not SoundDebounce then
- SoundDebounce = true
- SF.Notification:play()
- end
- delay(1.5, function()
- SoundDebounce = false
- wait(3)
- Frame.Vehicle:TweenPosition(Frame.Vehicle.Position + UDim2.new(2.25, 0, 0, 0), "Out", "Back", 0.3, false)
- wait(0.3)
- Frame:Destroy()
- end)
- end
- local Debounce = false
- local Waiting = false
- local MoneyChanged = false
- local StartUpFinished = false
- local BestCar = 0
- local Previous = 0
- local Target = 0
- function UpdateProgress()
- if Target then
- local Difference = Target - Previous
- local Money = Plr.Money.Value - Previous
- if Money > 0 then
- Progress.Bar.Size = UDim2.new(math.min(1, Money / Difference), 0, 1, 0)
- else
- Progress.Bar.Size = UDim2.new(0, 0, 1, 0)
- end
- else
- Progress.Bar.Size = UDim2.new(1, 0, 1, 0)
- end
- end
- function GiveUnlockedVehicles()
- for i, v in pairs(VList) do
- local Result, Afforded = rF.PurchVehicle:InvokeServer(v, true)
- if Result == "Low Cash" then
- Target = game.ReplicatedStorage.VehicleInformation:FindFirstChild(VList[i]).Price.Value
- break
- elseif Result == "Low Tokens" then
- Target = false
- break
- end
- end
- if Target == 0 then
- Target = false
- end
- end
- function CheckBestVehicle()
- local Owned = rF.GetOwned:InvokeServer()
- for i, v in pairs(VList) do
- for _, a in pairs(Owned) do
- if a == v then
- BestCar = i
- end
- end
- end
- end
- spawn(function()
- repeat
- wait()
- until not LoadingGamepasses
- GiveUnlockedVehicles()
- CheckBestVehicle()
- Previous = game.ReplicatedStorage.VehicleInformation:FindFirstChild(VList[BestCar]).Price.Value
- if Target then
- Progress.Label.Text = "Next Vehicle: " .. Rounder:ConvertAccurate(Target)
- else
- Progress.Label.Text = "Max"
- end
- UpdateProgress()
- StartUpFinished = true
- end)
- function CheckCar(Car)
- local Result, Afforded = rF.PurchVehicle:InvokeServer(VList[Car], true)
- if Result == "Bought" then
- if Dealing then
- if game.ReplicatedStorage.VehicleInformation:FindFirstChild(VList[Car]).VipOnly.Value == true then
- ListFrameBack.VehicleList:FindFirstChild(VList[Car]).Color.BackgroundColor3 = Color3.fromRGB(109, 61, 255)
- DTbar.VehicleBar:FindFirstChild(VList[Car]).Color.BackgroundColor3 = Color3.fromRGB(109, 61, 255)
- elseif game.ReplicatedStorage.VehicleInformation:FindFirstChild(VList[Car]).GroupOnly.Value == true then
- ListFrameBack.VehicleList:FindFirstChild(VList[Car]).Color.BackgroundColor3 = Color3.fromRGB(50, 150, 255)
- DTbar.VehicleBar:FindFirstChild(VList[Car]).Color.BackgroundColor3 = Color3.fromRGB(50, 150, 255)
- else
- ListFrameBack.VehicleList:FindFirstChild(VList[Car]).Color.BackgroundColor3 = color
- DTbar.VehicleBar:FindFirstChild(VList[Car]).Color.BackgroundColor3 = color
- end
- else
- AddNotification(Car)
- end
- end
- if Afforded == true then
- BestCar = BestCar + 1
- if BestCar < VehicleAmount then
- CheckCar(BestCar + 1)
- else
- Target = false
- Progress.Label.Text = "Max"
- UpdateProgress()
- end
- elseif Target < game.ReplicatedStorage.VehicleInformation:FindFirstChild(VList[Car]).Price.Value then
- if Result == "Low Cash" then
- Previous = Target
- Target = game.ReplicatedStorage.VehicleInformation:FindFirstChild(VList[Car]).Price.Value
- Progress.Label.Text = "Next Vehicle: " .. Rounder:ConvertAccurate(Target)
- UpdateProgress()
- elseif Result ~= "Low Tokens" and Car < VehicleAmount then
- CheckCar(Car + 1)
- else
- Target = false
- Progress.Label.Text = "Max"
- UpdateProgress()
- end
- end
- Result, Afforded = nil, nil
- end
- Plr.Money.Changed:connect(function()
- if not StartUpFinished then
- repeat
- wait(0.1)
- until StartUpFinished == true
- end
- if not Waiting then
- Waiting = true
- MoneyChanged = true
- wait()
- Waiting = false
- UpdateProgress()
- if not Debounce and BestCar < VehicleAmount and Target then
- Debounce = true
- MoneyChanged = false
- CheckCar(BestCar + 1)
- if Dealing and 1 <= #Cam:GetChildren() then
- UpdateRequirements(GetCurrentCarValue().Name)
- end
- wait(5)
- Debounce = false
- wait(5)
- if MoneyChanged and not Debounce and BestCar < VehicleAmount and Target then
- CheckCar(BestCar + 1)
- if Dealing and 1 <= #Cam:GetChildren() then
- UpdateRequirements(GetCurrentCarValue().Name)
- end
- end
- end
- end
- end)
- local ExitColor = SideBar.Exit.ImageColor3
- local ExitDisabled = false
- function ExitDealership(Hidden)
- ShopOpen = false
- ListFrameBack.Parent.Visible = false
- ListFrameBack.Position = UDim2.new(-5.1, 0, 0, DealershipGUI.MeasureMent.AbsoluteSize.Y)
- ListOpen = false
- DealershipGUI.JoinGroup.Visible = false
- DealershipGUI.JoinGroup.Background.Position = UDim2.new(-3.5, 0, 0, DealershipGUI.MeasureMent.AbsoluteSize.Y)
- G_Open = false
- Music.Value = 0
- ChangingMusic.Value = true
- BScrnIn()
- Dealing = false
- Cam.CameraSubject = Plr.Character.Humanoid
- Cam.CameraType = "Custom"
- Plr.CameraMaxZoomDistance = 250
- View = 1
- if 1 <= #Cam:GetChildren() then
- rE.ClearModels:FireServer()
- end
- CurrentCar = {}
- if not Hidden and OpenVM then
- VehicleMenu.Menu.Visible = true
- end
- if PlrGui:FindFirstChild("Interface") then
- PlrGui.Interface.Enabled = true
- end
- if MeltDownActive.Value and not MobileUser then
- Scrn.Message.Position = MessagePos1
- end
- TBar.Visible = true
- DealershipGUI.BottomBar.Visible = false
- DealershipGUI.TopBar.Visible = false
- SideBar.Exit.HoverLabel.Visible = false
- SideBar.Exit.ImageColor3 = ExitColor
- game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
- if MobileUser then
- US.ModalEnabled = false
- end
- ButtonHover = false
- Music.Value = PrevSong
- DealershipModel.Parent = nil
- GarageModel.Parent = nil
- BScrnOut()
- ChangingMusic.Value = false
- end
- SideBar.Exit.MouseButton1Click:connect(function()
- BtnClickAnim(SideBar.Exit)
- if not ExitDisabled then
- Fading = true
- ExitDealership()
- Fading = false
- end
- end)
- SideBar.Exit.MouseEnter:connect(function()
- if not ButtonHover and not ExitDisabled then
- ButtonHover = true
- SideBar.Exit.ImageColor3 = SideBar.Exit.HoverColor.Value
- SideBar.Exit.down.ImageColor3 = SideBar.Exit.HoverColor.Value
- SideBar.Exit.HoverLabel.Visible = true
- SF.ButtonHover:Play()
- elseif not ButtonHover then
- ButtonHover = true
- SideBar.Exit.ImageColor3 = SideBar.Exit.DisabledColorHover.Value
- SideBar.Exit.down.ImageColor3 = SideBar.Exit.DisabledColorHover.Value
- SideBar.Exit.HoverLabel.Visible = true
- SF.ButtonHover:Play()
- end
- SideBar.Exit.MouseLeave:connect(function()
- if not ExitDisabled then
- SideBar.Exit.ImageColor3 = ExitColor
- SideBar.Exit.down.ImageColor3 = ExitColor
- SideBar.Exit.HoverLabel.Visible = false
- ButtonHover = false
- else
- SideBar.Exit.ImageColor3 = SideBar.Exit.DisabledColor.Value
- SideBar.Exit.down.ImageColor3 = SideBar.Exit.DisabledColor.Value
- SideBar.Exit.HoverLabel.Visible = false
- ButtonHover = false
- end
- end)
- end)
- local Title = ListFrameBack.Title
- local SortChoices = {
- Title.Sort.Parts,
- Title.Sort.Speed,
- Title.Sort.Price
- }
- local DirChoices = {
- Title.Direction.Low,
- Title.Direction.High
- }
- local SortOpen = false
- local DirectionOpen = false
- local Direction = 1
- SideBar.List.MouseButton1Click:connect(function()
- BtnClickAnim(SideBar.List)
- if not ListOpen and not AnimationActive then
- ListOpen = true
- AnimationActive = true
- ListFrameBack.Parent.Visible = true
- SF.Swoosh.PlaybackSpeed = 1.3
- SF.Swoosh:play()
- ListFrameBack:TweenPosition(UDim2.new(-5.1, 0, 0, (DealershipGUI.MeasureMent.AbsoluteSize.Y - ListFrameBack.AbsoluteSize.Y) / 2), "In", "Sine", 0.3, false)
- wait(0.3)
- AnimationActive = false
- SideBar.List.ImageColor3 = color
- SideBar.List.down.ImageColor3 = color
- SideBar.List.HoverLabel.Visible = false
- ListHover = false
- elseif not AnimationActive then
- ListOpen = false
- AnimationActive = true
- SF.Swoosh.PlaybackSpeed = 1
- SF.Swoosh:play()
- ListFrameBack:TweenPosition(UDim2.new(-5.1, 0, 0, DealershipGUI.MeasureMent.AbsoluteSize.Y), "Out", "Sine", 0.5, false)
- wait(0.5)
- ListFrameBack.Parent.Visible = false
- AnimationActive = false
- end
- end)
- SideBar.List.MouseEnter:connect(function()
- if not ListHover then
- ListHover = true
- SideBar.List.ImageColor3 = SideBar.List.HoverColor.Value
- SideBar.List.down.ImageColor3 = SideBar.List.HoverColor.Value
- SideBar.List.HoverLabel.Visible = true
- SF.ButtonHover:Play()
- end
- SideBar.List.MouseLeave:connect(function()
- SideBar.List.ImageColor3 = color
- SideBar.List.down.ImageColor3 = color
- SideBar.List.HoverLabel.Visible = false
- ListHover = false
- end)
- end)
- Title.Sort.MouseButton1Click:connect(function()
- SF.ButtonClick2D:play()
- if not SortOpen then
- SortOpen = true
- Title.Sort.BackgroundTransparency = 0.5
- Title.Sort.BackgroundColor3 = Color3.fromRGB(40, 123, 205)
- Title.Sort.BorderSizePixel = 2
- Title.Sort.Arrow.Rotation = 180
- for _, v in pairs(SortChoices) do
- v.Visible = true
- end
- else
- SortOpen = false
- Title.Sort.BackgroundTransparency = 0
- Title.Sort.BackgroundColor3 = Color3.fromRGB(50, 150, 255)
- Title.Sort.BorderSizePixel = 0
- Title.Sort.Arrow.Rotation = 0
- for _, v in pairs(SortChoices) do
- v.Visible = false
- end
- end
- end)
- Title.Sort.MouseEnter:connect(function()
- SF.ButtonHover:play()
- end)
- for _, v in pairs(SortChoices) do
- v.MouseButton1Click:connect(function()
- SF.ButtonClick2D:play()
- if v.Name == "Price" then
- for _, a in pairs(ListFrameBack.VehicleList:GetChildren()) do
- if a:IsA("Frame") then
- a.LayoutOrder = a.P.Value * Direction
- end
- end
- else
- for _, a in pairs(ListFrameBack.VehicleList:GetChildren()) do
- if a:IsA("Frame") then
- a.LayoutOrder = game.ReplicatedStorage.VehicleInformation:FindFirstChild(a.Name):FindFirstChild(v.Name).Value * Direction
- end
- end
- end
- end)
- v.MouseEnter:connect(function()
- SF.ButtonHover:play()
- end)
- end
- Title.Direction.MouseButton1Click:connect(function()
- SF.ButtonClick2D:play()
- if not DirectionOpen then
- DirectionOpen = true
- Title.Direction.BackgroundTransparency = 0.5
- Title.Direction.BackgroundColor3 = Color3.fromRGB(40, 123, 205)
- Title.Direction.BorderSizePixel = 2
- Title.Direction.Arrow.Rotation = 180
- for _, v in pairs(DirChoices) do
- v.Visible = true
- end
- else
- DirectionOpen = false
- Title.Direction.BackgroundTransparency = 0
- Title.Direction.BackgroundColor3 = Color3.fromRGB(50, 150, 255)
- Title.Direction.BorderSizePixel = 0
- Title.Direction.Arrow.Rotation = 0
- for _, v in pairs(DirChoices) do
- v.Visible = false
- end
- end
- end)
- Title.Direction.MouseEnter:connect(function()
- SF.ButtonHover:play()
- end)
- for _, v in pairs(DirChoices) do
- v.MouseButton1Click:connect(function()
- SF.ButtonClick2D:play()
- if Direction ~= v.Val.Value then
- Direction = v.Val.Value
- for _, a in pairs(ListFrameBack.VehicleList:GetChildren()) do
- if a:IsA("Frame") then
- a.LayoutOrder = a.LayoutOrder * -1
- end
- end
- end
- end)
- v.MouseEnter:connect(function()
- SF.ButtonHover:play()
- end)
- end
- ListFrameBack.Hide.MouseButton1Click:connect(function()
- SF.ButtonClick2D:play()
- if not AnimationActive then
- AnimationActive = true
- ListOpen = false
- SF.Swoosh.PlaybackSpeed = 1
- SF.Swoosh:play()
- ListFrameBack:TweenPosition(UDim2.new(-5.1, 0, 0, DealershipGUI.MeasureMent.AbsoluteSize.Y), "Out", "Sine", 0.5, false)
- wait(0.5)
- ListFrameBack.Parent.Visible = false
- AnimationActive = false
- end
- end)
- ListFrameBack.Hide.MouseEnter:connect(function()
- SF.ButtonHover:play()
- end)
- local DHideFrame = DTbar.Stats.Holder.hide
- local DTBarHidden = false
- DHideFrame:WaitForChild("ClickBox").MouseButton1Click:connect(function()
- if not AnimationActive and not DTBarDisabled then
- AnimationActive = true
- SF.ButtonClick2D:play()
- if DTBarHidden then
- DTBarHidden = false
- DHideFrame.up.Visible = true
- DHideFrame.down.Visible = false
- DTbar.VehicleBar.Visible = true
- DTbar:TweenPosition(UDim2.new(0, 0, 0, 0), "In", "Back", 0.3, false)
- wait(0.3)
- else
- DTBarHidden = true
- DHideFrame.up.Visible = false
- DHideFrame.down.Visible = true
- DTbar:TweenPosition(UDim2.new(0, 0, 0, -(DTbar.AbsoluteSize.Y - 4)), "Out", "Back", 0.3, false)
- wait(0.2)
- DTbar.VehicleBar.Visible = false
- wait(0.1)
- end
- AnimationActive = false
- end
- end)
- DTbar:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
- if DTBarHidden then
- DTbar.Position = UDim2.new(0, 0, 0, -(DTbar.AbsoluteSize.Y - 4))
- end
- end)
- DealershipGUI.JoinGroup.Background.Frame.Button.MouseButton1Click:connect(function()
- BtnClickAnim(DealershipGUI.JoinGroup.Background.Frame.Button)
- if not AnimationActive then
- AnimationActive = true
- SF.Swoosh.PlaybackSpeed = 1
- SF.Swoosh:play()
- DealershipGUI.JoinGroup.Background:TweenPosition(UDim2.new(-3.5, 0, 0, DealershipGUI.MeasureMent.AbsoluteSize.Y), "Out", "Sine", 0.5, false)
- wait(0.5)
- DealershipGUI.JoinGroup.Visible = false
- DealershipGUI.JoinGroup.Background.Frame.Button.ImageColor3 = color
- AnimationActive = false
- ButtonHover = false
- G_Open = false
- end
- end)
- DealershipGUI.JoinGroup.Background.Frame.Button.MouseEnter:connect(function()
- if not ButtonHover then
- ButtonHover = true
- DealershipGUI.JoinGroup.Background.Frame.Button.ImageColor3 = DealershipGUI.JoinGroup.Background.Frame.Button.HoverColor.Value
- DealershipGUI.JoinGroup.Background.Frame.Button.down.ImageColor3 = DealershipGUI.JoinGroup.Background.Frame.Button.HoverColor.Value
- SF.ButtonHover:Play()
- end
- DealershipGUI.JoinGroup.Background.Frame.Button.MouseLeave:connect(function()
- DealershipGUI.JoinGroup.Background.Frame.Button.ImageColor3 = color
- DealershipGUI.JoinGroup.Background.Frame.Button.down.ImageColor3 = color
- ButtonHover = false
- end)
- end)
- CustBtn.MouseButton1Click:connect(function()
- if not CustDisabled then
- BtnClickAnim(CustBtn)
- if not AnimationActive and not ScrollDebounce and GetCurrentCarValue() then
- AnimationActive = true
- local Folder = game.ReplicatedStorage.VehicleInformation:FindFirstChild(GetCurrentCarValue().Name)
- local DefaultValue = Folder.StandardValue.Value
- StandardValue = Folder.Value.Value
- SF.Swoosh.PlaybackSpeed = 1
- SF.Swoosh:play()
- StatsBack:TweenPosition(UDim2.new(-4.1, 0, 0, 0), "Out", "Back", 0.5, false)
- ListFrameBack:TweenPosition(UDim2.new(-5.1, 0, 0, DealershipGUI.MeasureMent.AbsoluteSize.Y), "Out", "Sine", 0.5, false)
- ListOpen = false
- Holder.Previous:TweenPosition(UDim2.new(0, 0, 1.2, 0), "Out", "Back", 0.5, false)
- Holder.Next:TweenPosition(UDim2.new(0.82, 0, 1.2, 0), "Out", "Back", 0.5, false)
- SideBar:TweenPosition(UDim2.new(1.25, 0, 1.08, 0), "Out", "Back", 0.5, false)
- DTBarHidden = true
- DTBarDisabled = true
- DHideFrame.up.Visible = false
- DHideFrame.down.Visible = true
- DTbar:TweenPosition(UDim2.new(0, 0, 0, -(DTbar.AbsoluteSize.Y - 4)), "Out", "Back", 0.3, false)
- wait(0.2)
- DTbar.VehicleBar.Visible = false
- wait(0.3)
- ListFrameBack.Parent.Visible = false
- DealershipGUI.CustomizeExit.Visible = true
- DealershipGUI.Customize.Visible = true
- CustBtn.ImageColor3 = Blue
- ButtonHover = false
- local CurrentValue = GetCurrentCarValue().Value.Value
- if CurrentValue > StandardValue then
- Holder.Value.Text = "Value: " .. Rounder:ConvertAccurate(CurrentValue)
- Holder.Value.TextColor3 = color
- Holder.DefaultValue.Text = "Default Value: " .. Rounder:ConvertAccurate(CurrentValue - (StandardValue - DefaultValue))
- Holder.DefaultValue.TextColor3 = color
- else
- Holder.Value.Text = "Value: " .. Rounder:ConvertAccurate(StandardValue)
- Holder.Value.TextColor3 = Color3.new(1, 1, 1)
- Holder.DefaultValue.Text = "Default Value: " .. Rounder:ConvertAccurate(DefaultValue)
- Holder.DefaultValue.TextColor3 = Color3.fromRGB(205, 205, 205)
- end
- Holder.TokenBonus.Text = "Token Bonus: + " .. Rounder:ConvertAccurate(StandardValue - DefaultValue)
- GetCurrentCarValue():SetPrimaryPartCFrame(GarageModel.VehicleSpawn.CFrame)
- Cam.CameraSubject = GarageModel.CameraFocus
- Cam.CFrame = GarageModel.CameraFocus.CFrame
- View = 5
- SF.Swoosh.PlaybackSpeed = 1.2
- SF.Swoosh:play()
- DealershipGUI.CustomizeExit.Exit:TweenPosition(UDim2.new(-1.19, 0, 0.1, 0), "In", "Back", 0.3, false)
- DealershipGUI.Customize.Background:TweenPosition(UDim2.new(0, 0, 0, 0), "In", "Back", 0.3, false)
- DealershipGUI.Customize.ColorName:TweenPosition(UDim2.new(0, 0, 8.945, 0), "In", "Back", 0.3, false)
- Holder.Value:TweenPosition(UDim2.new(-0.5, 0, -0.5, 0), "In", "Back", 0.3, false)
- if 0 < LStats.Tokens.Value then
- Holder.TokenBonus:TweenPosition(UDim2.new(-0.5, 0, -0.8, 0), "In", "Back", 0.3, false)
- Holder.DefaultValue:TweenPosition(UDim2.new(-0.5, 0, -1.1, 0), "In", "Back", 0.3, false)
- end
- wait(0.3)
- AnimationActive = false
- end
- end
- end)
- CustBtn.MouseEnter:connect(function()
- local Color = CustBtn.ImageColor3
- if not ButtonHover and not CustDisabled then
- ButtonHover = true
- CustBtn.ImageColor3 = CustBtn.HoverColor.Value
- CustBtn.down.ImageColor3 = CustBtn.HoverColor.Value
- SF.ButtonHover:Play()
- end
- CustBtn.MouseLeave:connect(function()
- if not CustDisabled then
- CustBtn.ImageColor3 = Color
- CustBtn.down.ImageColor3 = Color
- ButtonHover = false
- end
- end)
- end)
- CExit.MouseButton1Click:connect(function()
- if not AnimationActive then
- AnimationActive = true
- BtnClickAnim(CExit)
- SF.Swoosh.PlaybackSpeed = 1
- SF.Swoosh:play()
- CExit:TweenPosition(UDim2.new(0, 0, -1, 0), "Out", "Back", 0.5, false)
- DealershipGUI.Customize.Background:TweenPosition(UDim2.new(-5, 0, 0, 0), "Out", "Back", 0.5, false)
- DealershipGUI.Customize.ColorName:TweenPosition(UDim2.new(-5, 0, 8.945, 0), "Out", "Back", 0.5, false)
- Holder.Value:TweenPosition(UDim2.new(-0.5, 0, 0.25, 0), "Out", "Back", 0.5, false)
- Holder.TokenBonus:TweenPosition(UDim2.new(-0.5, 0, 0.25, 0), "Out", "Back", 0.5, false)
- Holder.DefaultValue:TweenPosition(UDim2.new(-0.5, 0, 0.25, 0), "Out", "Back", 0.5, false)
- wait(0.5)
- DealershipGUI.CustomizeExit.Visible = false
- DealershipGUI.Customize.Visible = false
- CExit.ImageColor3 = Blue
- CExit.HoverLabel.Visible = false
- ButtonHover = false
- GetCurrentCarValue():SetPrimaryPartCFrame(DealershipModel.VehicleSpawn.CFrame)
- Cam.CameraSubject = DealershipModel.CameraFocus
- Cam.CFrame = DealershipModel.CameraFocus.CFrame
- View = 4
- SF.Swoosh.PlaybackSpeed = 1.2
- SF.Swoosh:play()
- StatsBack:TweenPosition(UDim2.new(-0.1, 0, 0, 0), "In", "Back", 0.3, false)
- SideBar:TweenPosition(UDim2.new(1, 0, 1.08, 0), "In", "Back", 0.3, false)
- Holder.Previous:TweenPosition(UDim2.new(0, 0, 0, 0), "In", "Back", 0.3, false)
- Holder.Next:TweenPosition(UDim2.new(0.82, 0, 0, 0), "In", "Back", 0.3, false)
- SaveCustomizations()
- wait(0.3)
- DTBarDisabled = false
- AnimationActive = false
- end
- end)
- CExit.MouseEnter:connect(function()
- local Color = CExit.ImageColor3
- CExit.ImageColor3 = CExit.HoverColor.Value
- CExit.down.ImageColor3 = CExit.HoverColor.Value
- SF.ButtonHover:Play()
- CExit.HoverLabel.Visible = true
- CExit.MouseLeave:connect(function()
- CExit.ImageColor3 = Color
- CExit.down.ImageColor3 = Color
- CExit.HoverLabel.Visible = false
- end)
- end)
- local PaintPlaying = false
- local MaterialPlaying = false
- for _, ColorButton in pairs(CustScroll:GetChildren()) do
- if ColorButton:IsA("ImageButton") then
- ColorButton.MouseButton1Click:connect(function()
- BtnClickAnim(ColorButton)
- CustomizationChange = true
- local InformationFolder = game.ReplicatedStorage.VehicleInformation:FindFirstChild(GetCurrentCarValue().Name)
- local NormalValue = InformationFolder.StandardValue.Value
- if not ColorButton:FindFirstChild("LockImage") or ColorButton:FindFirstChild("LockImage").Visible == false and InformationFolder then
- local PAINT
- for _, v in pairs(GetCurrentCarValue().Car.Body.Parts.Paint:GetChildren()) do
- if v:IsA("BasePart") then
- PAINT = v
- break
- end
- end
- if ColorButton:FindFirstChild("Name") and not MaterialPlaying then
- MaterialPlaying = true
- SF.Material:play()
- if ColorButton.Name == "Regular" then
- local PartColor = PAINT.BrickColor
- if not ColorChanged then
- PartColor = InformationFolder.BodyColor.Value
- end
- ChangeVehicleProps(GetCurrentCarValue(), PartColor, "Standard", "Standard", StandardValue, NormalValue, Color3.new(1, 1, 1))
- elseif ColorButton.Name == "Metal" then
- local PartColor = PAINT.BrickColor
- if not ColorChanged then
- PartColor = InformationFolder.BodyColor.Value
- end
- ChangeVehicleProps(GetCurrentCarValue(), PartColor, "Metal", 0, StandardValue, NormalValue, Color3.new(1, 1, 1))
- elseif ColorButton.Name == "Neon" then
- local PartColor = PAINT.BrickColor
- if not ColorChanged then
- PartColor = InformationFolder.BodyColor.Value
- end
- ChangeVehicleProps(GetCurrentCarValue(), PartColor, "Neon", 0, math.ceil(StandardValue + NormalValue * 0.25), math.ceil(NormalValue * 1.25), color)
- elseif ColorButton.Name == "Silver" then
- ChangeVehicleProps(GetCurrentCarValue(), BrickColor.new("Pearl"), "SmoothPlastic", 0.45, math.ceil(StandardValue + NormalValue * 0.5), math.ceil(NormalValue * 1.5), color)
- ColorChanged = false
- elseif ColorButton.Name == "Gold" then
- ChangeVehicleProps(GetCurrentCarValue(), BrickColor.new("Bright yellow"), "SmoothPlastic", 0.6, math.ceil(StandardValue + NormalValue * 1), math.ceil(NormalValue * 2), color)
- ColorChanged = false
- elseif ColorButton.Name == "Platinum" then
- ChangeVehicleProps(GetCurrentCarValue(), BrickColor.new("Institutional white"), "SmoothPlastic", 1, math.ceil(StandardValue + NormalValue * 2), math.ceil(NormalValue * 3), color)
- ColorChanged = false
- end
- wait(0.5)
- MaterialPlaying = false
- elseif ColorButton:FindFirstChild("BrickColor") and not PaintPlaying then
- PaintPlaying = true
- ColorChanged = true
- SF.Paint:play()
- local Reflectance = PAINT.Reflectance
- if Reflectance == 1 and ColorButton:FindFirstChild("BrickColor").Value ~= BrickColor.new("Institutional white") then
- Reflectance = 0.8
- elseif Reflectance > 0.79 and Reflectance < 0.81 and ColorButton:FindFirstChild("BrickColor").Value == BrickColor.new("Institutional white") then
- Reflectance = 1
- end
- ChangeVehicleProps(GetCurrentCarValue(), ColorButton:FindFirstChild("BrickColor").Value, PAINT.Material, Reflectance)
- wait(1)
- for i = 0, 10 do
- SF.Paint.Volume = SF.Paint.Volume - 0.15
- wait()
- end
- SF.Paint:stop()
- SF.Paint.Volume = 1.5
- PaintPlaying = false
- end
- elseif ColorButton:FindFirstChild("LockImage").Visible == true then
- if ColorButton.Name == "PremiumColor" then
- MP:PromptPurchase(Plr, Gpasses[1])
- elseif ColorButton.Name == "Neon" then
- MP:PromptPurchase(Plr, Gpasses[3])
- elseif ColorButton.Name == "Silver" then
- MP:PromptPurchase(Plr, Gpasses[4])
- elseif ColorButton.Name == "Gold" then
- MP:PromptPurchase(Plr, Gpasses[9])
- elseif ColorButton.Name == "Platinum" then
- MP:PromptPurchase(Plr, Gpasses[10])
- end
- end
- end)
- ColorButton.MouseEnter:connect(function()
- local Color = ColorButton.ImageColor3
- if not ButtonHover then
- ButtonHover = true
- if ColorButton.Name == "Color" or ColorButton.Name == "PremiumColor" then
- DealershipGUI.Customize.ColorName.Background.TextLabel.Text = ColorButton:FindFirstChild("BrickColor").Value.Name
- else
- DealershipGUI.Customize.ColorName.Background.TextLabel.Text = ColorButton:FindFirstChild("Name").Value
- end
- ColorButton.ImageColor3 = ColorButton.HoverColor.Value
- ColorButton.down.ImageColor3 = ColorButton.HoverColor.Value
- SF.ButtonHover:Play()
- end
- ColorButton.MouseLeave:connect(function()
- ColorButton.ImageColor3 = Color
- ColorButton.down.ImageColor3 = Color
- DealershipGUI.Customize.ColorName.Background.TextLabel.Text = ""
- ButtonHover = false
- end)
- end)
- end
- end
- local Backg = SettingsGUI.Settings.Background
- local DescBg = Backg.Description.Background
- local ConfirmTransFrame = SettingsGUI.ConfirmTransfer.Background.Frame
- local ConfirmQualityFrame = SettingsGUI.ConfirmQuality.Background.Frame
- local SettingsFrame = Backg.ScrollingFrame
- local CancelColor = ConfirmTransFrame.Cancel.ImageColor3
- local CancelColorHover = ConfirmTransFrame.Cancel.HoverColor.Value
- local ConfirmHover = ConfirmTransFrame.Confirm.HoverColor.Value
- local SpawnBtns = {
- SettingsFrame.Row1,
- SettingsFrame.Row2,
- SettingsFrame.Row3,
- SettingsFrame.Row4,
- SettingsFrame.Random
- }
- local MusicHover, QualityHover, SpeedHover, InvinHover, SusHover = false, false, false, false, false
- local TransferEnabled, InvinUnlocked = false, false
- local SpawnPoint = 5
- local ActiveBtn = SettingsFrame.Random
- function UpdateTransBtn(Val)
- if Val <= Plr.Money.Value then
- SettingsFrame.Transfer.ImageColor3 = SettingsFrame.Transfer.ActiveColor.Value
- SettingsFrame.Transfer.down.ImageColor3 = SettingsFrame.Transfer.ActiveColor.Value
- SettingsFrame.Requirement.Visible = false
- TransferEnabled = true
- else
- SettingsFrame.Transfer.ImageColor3 = SettingsFrame.Transfer.LockedColor.Value
- SettingsFrame.Transfer.down.ImageColor3 = SettingsFrame.Transfer.LockedColor.Value
- SettingsFrame.Requirement.Visible = true
- TransferEnabled = false
- end
- end
- function UpdateTransferReqs()
- if LStats.Tokens.Value == 0 then
- SettingsFrame.Requirement.Text = "Requires 10B Money"
- ConfirmTransFrame.Multiplier.Text = "- 1.5x vehicle value multiplier increasing the value of all the vehicles in the game"
- UpdateTransBtn(10000000000)
- elseif LStats.Tokens.Value == 1 then
- SettingsFrame.Requirement.Text = "Requires 50B Money"
- SettingsFrame.CurrentBonus.Text = "Current vehicle value multiplier: 1.5x"
- ConfirmTransFrame.Multiplier.Text = "- 2x vehicle value multiplier"
- ConfirmTransFrame.Multiplier.Size = UDim2.new(0.4, 0, 0.2, 0)
- UpdateTransBtn(50000000000)
- elseif LStats.Tokens.Value == 2 then
- SettingsFrame.Requirement.Text = "Requires 250B Money"
- SettingsFrame.CurrentBonus.Text = "Current vehicle value multiplier: 2x"
- ConfirmTransFrame.Multiplier.Text = "- 2.5x vehicle value multiplier"
- ConfirmTransFrame.Multiplier.Size = UDim2.new(0.4, 0, 0.2, 0)
- UpdateTransBtn(250000000000)
- elseif LStats.Tokens.Value == 3 then
- SettingsFrame.Transfer.ImageColor3 = SettingsFrame.Transfer.LockedColor.Value
- SettingsFrame.Transfer.down.ImageColor3 = SettingsFrame.Transfer.LockedColor.Value
- SettingsFrame.CurrentBonus.Text = "Current vehicle value multiplier: 2.5x"
- SettingsFrame.Requirement.Visible = false
- TransferEnabled = false
- end
- end
- Menu.Settings.MouseButton1Click:connect(function()
- BtnClickAnim(Menu.Settings)
- if not SettingsIsOpen and not AnimationActive then
- AnimationActive = true
- SettingsGUI.Settings.Visible = true
- UpdateTransferReqs()
- SF.Swoosh.PlaybackSpeed = 1.3
- SF.Swoosh:play()
- Backg:TweenPosition(UDim2.new(-3.5, 0, 0, (DealershipGUI.MeasureMent.AbsoluteSize.Y - Backg.AbsoluteSize.Y) / 2), "In", "Sine", 0.3, false)
- wait(0.3)
- SettingsIsOpen = true
- AnimationActive = false
- elseif not AnimationActive and not SettingsGUI.ConfirmTransfer.Visible then
- SettingsIsOpen = false
- AnimationActive = true
- SF.Swoosh.PlaybackSpeed = 1
- SF.Swoosh:play()
- Backg:TweenPosition(UDim2.new(-3.5, 0, 0, DealershipGUI.MeasureMent.AbsoluteSize.Y), "Out", "Sine", 0.5, false)
- wait(0.5)
- SettingsGUI.Settings.Visible = false
- AnimationActive = false
- end
- end)
- Menu.Settings.MouseEnter:connect(function()
- if not ButtonHover then
- ButtonHover = true
- Menu.Settings.ImageColor3 = Menu.Settings.HoverColor.Value
- Menu.Settings.down.ImageColor3 = Menu.Settings.HoverColor.Value
- SF.ButtonHover:Play()
- end
- Menu.Settings.MouseLeave:connect(function()
- Menu.Settings.ImageColor3 = color
- Menu.Settings.down.ImageColor3 = color
- ButtonHover = false
- end)
- end)
- Backg:WaitForChild("Hide").MouseButton1Click:connect(function()
- if not AnimationActive and SettingsIsOpen then
- SettingsIsOpen = false
- AnimationActive = true
- SF.ButtonClick2D:play()
- SF.Swoosh.PlaybackSpeed = 1
- SF.Swoosh:Play()
- Backg:TweenPosition(UDim2.new(-3.5, 0, 0, DealershipGUI.MeasureMent.AbsoluteSize.Y), "Out", "Sine", 0.5, false)
- wait(0.5)
- SettingsGUI.Settings.Visible = false
- AnimationActive = false
- end
- end)
- Backg:WaitForChild("Hide").MouseEnter:connect(function()
- SF.ButtonHover:Play()
- end)
- if MP:PlayerOwnsAsset(Plr, 384451107) or MP:PlayerOwnsAsset(Plr, Gpasses[6]) then
- InvinUnlocked = true
- if Settings.Invincibility.Value then
- SettingsFrame.Invincibility.ImageColor3 = color
- SettingsFrame.Invincibility.down.ImageColor3 = color
- SettingsFrame.Invincibility.TextLabel.Text = "ON"
- rF.ChangeSetting:InvokeServer(1, true)
- end
- end
- if Settings.MusicDisabled.Value then
- SettingsFrame.Music.ImageColor3 = SettingsFrame.Music.DisabledColor.Value
- SettingsFrame.Music.down.ImageColor3 = SettingsFrame.Music.DisabledColor.Value
- SettingsFrame.Music.TextLabel.Text = "OFF"
- end
- if not Settings.SusDisabled.Value then
- SettingsFrame.Suspension.ImageColor3 = color
- SettingsFrame.Suspension.down.ImageColor3 = color
- SettingsFrame.Suspension.TextLabel.Text = "Enabled"
- end
- if Settings.SpeedUnit.Value == 2 then
- SettingsFrame.Speed.ImageColor3 = SettingsFrame.Speed.KPHColor.Value
- SettingsFrame.Speed.down.ImageColor3 = SettingsFrame.Speed.KPHColor.Value
- SettingsFrame.Speed.TextLabel.Text = "KM/H"
- end
- if Settings.Quality.Value == 1 then
- SettingsFrame.Quality.ImageColor3 = SettingsFrame.Quality.LowColor.Value
- SettingsFrame.Quality.down.ImageColor3 = SettingsFrame.Quality.LowColor.Value
- SettingsFrame.Quality.TextLabel.Text = "Lowered"
- end
- SettingsFrame.Music.MouseButton1Click:connect(function()
- BtnClickAnim(SettingsFrame.Music)
- if not Settings.MusicDisabled.Value then
- if MusicHover then
- SettingsFrame.Music.ImageColor3 = SettingsFrame.Music.DisabledColorHover.Value
- SettingsFrame.Music.down.ImageColor3 = SettingsFrame.Music.DisabledColorHover.Value
- else
- SettingsFrame.Music.ImageColor3 = SettingsFrame.Music.DisabledColor.Value
- SettingsFrame.Music.down.ImageColor3 = SettingsFrame.Music.DisabledColor.Value
- end
- local CurrentSong = Music.Value
- Music.Value = 0
- SettingsFrame.Music.TextLabel.Text = "OFF"
- DescBg.Text1.Text = "Enable game music"
- rF.ChangeSetting:InvokeServer(3, true)
- Music.Value = CurrentSong
- else
- if MusicHover then
- SettingsFrame.Music.ImageColor3 = SettingsFrame.Music.EnabledColorHover.Value
- SettingsFrame.Music.down.ImageColor3 = SettingsFrame.Music.EnabledColorHover.Value
- else
- SettingsFrame.Music.ImageColor3 = color
- SettingsFrame.Music.down.ImageColor3 = color
- end
- local CurrentSong = Music.Value
- Music.Value = 4
- SettingsFrame.Music.TextLabel.Text = "ON"
- DescBg.Text1.Text = "Disable game music"
- rF.ChangeSetting:InvokeServer(3, false)
- ChangingMusic.Value = true
- Music.Value = CurrentSong
- wait(0.3)
- ChangingMusic.Value = false
- end
- end)
- SettingsFrame.Music.MouseEnter:connect(function()
- if Settings.MusicDisabled.Value then
- SettingsFrame.Music.ImageColor3 = SettingsFrame.Music.DisabledColorHover.Value
- SettingsFrame.Music.down.ImageColor3 = SettingsFrame.Music.DisabledColorHover.Value
- DescBg.Text1.Text = "Enable game music"
- else
- SettingsFrame.Music.ImageColor3 = SettingsFrame.Music.EnabledColorHover.Value
- SettingsFrame.Music.down.ImageColor3 = SettingsFrame.Music.EnabledColorHover.Value
- DescBg.Text1.Text = "Disable game music"
- end
- DescBg.Text2.Text = ""
- if not MusicHover then
- MusicHover = true
- SF.ButtonHover:Play()
- end
- SettingsFrame.Music.MouseLeave:connect(function()
- if Settings.MusicDisabled.Value then
- SettingsFrame.Music.ImageColor3 = SettingsFrame.Music.DisabledColor.Value
- SettingsFrame.Music.down.ImageColor3 = SettingsFrame.Music.DisabledColor.Value
- else
- SettingsFrame.Music.ImageColor3 = color
- SettingsFrame.Music.down.ImageColor3 = color
- end
- DescBg.Text1.Text = ""
- MusicHover = false
- end)
- end)
- SettingsFrame.Quality.MouseButton1Click:connect(function()
- BtnClickAnim(SettingsFrame.Quality)
- if Settings.Quality.Value == 2 then
- if QualityHover then
- SettingsFrame.Quality.ImageColor3 = SettingsFrame.Quality.LowColorHover.Value
- SettingsFrame.Quality.down.ImageColor3 = SettingsFrame.Quality.LowColorHover.Value
- else
- SettingsFrame.Quality.ImageColor3 = SettingsFrame.Quality.LowColor.Value
- SettingsFrame.Quality.down.ImageColor3 = SettingsFrame.Quality.LowColor.Value
- end
- SettingsFrame.Quality.TextLabel.Text = "Lowered"
- DescBg.Text2.Text = "Lowered quality: Parts will break directly instead of falling off most of the time (Less lag)"
- rF.ChangeSetting:InvokeServer(2, 1)
- elseif not MobileUser then
- if QualityHover then
- SettingsFrame.Quality.ImageColor3 = SettingsFrame.Quality.HighColorHover.Value
- SettingsFrame.Quality.down.ImageColor3 = SettingsFrame.Quality.HighColorHover.Value
- else
- SettingsFrame.Quality.ImageColor3 = color
- SettingsFrame.Quality.down.ImageColor3 = color
- end
- SettingsFrame.Quality.TextLabel.Text = "High"
- DescBg.Text2.Text = "High quality: Many parts will fall off the vehicle instead of getting destroyed instantly (More lag)"
- rF.ChangeSetting:InvokeServer(2, 2)
- else
- AnimationActive = true
- SF.Swoosh.PlaybackSpeed = 1.3
- SF.Swoosh:play()
- SettingsGUI.ConfirmQuality.Visible = true
- SettingsGUI.ConfirmQuality.Background:TweenPosition(UDim2.new(-3.5, 0, 0, (DealershipGUI.MeasureMent.AbsoluteSize.Y - SettingsGUI.ConfirmTransfer.Background.AbsoluteSize.Y) / 2), "In", "Sine", 0.3, false)
- wait(0.3)
- AnimationActive = false
- end
- end)
- SettingsFrame.Quality.MouseEnter:connect(function()
- if Settings.Quality.Value == 1 then
- SettingsFrame.Quality.ImageColor3 = SettingsFrame.Quality.LowColorHover.Value
- SettingsFrame.Quality.down.ImageColor3 = SettingsFrame.Quality.LowColorHover.Value
- DescBg.Text2.Text = "Lowered quality: Parts will break directly instead of falling off most of the time (Less lag)"
- else
- SettingsFrame.Quality.ImageColor3 = SettingsFrame.Quality.HighColorHover.Value
- SettingsFrame.Quality.down.ImageColor3 = SettingsFrame.Quality.HighColorHover.Value
- DescBg.Text2.Text = "High quality: Many parts will fall off the vehicle instead of getting destroyed instantly (More lag)"
- end
- DescBg.Text1.Text = ""
- if not QualityHover then
- QualityHover = true
- SF.ButtonHover:Play()
- end
- SettingsFrame.Quality.MouseLeave:connect(function()
- if Settings.Quality.Value == 1 then
- SettingsFrame.Quality.ImageColor3 = SettingsFrame.Quality.LowColor.Value
- SettingsFrame.Quality.down.ImageColor3 = SettingsFrame.Quality.LowColor.Value
- else
- SettingsFrame.Quality.ImageColor3 = color
- SettingsFrame.Quality.down.ImageColor3 = color
- end
- DescBg.Text2.Text = ""
- QualityHover = false
- end)
- end)
- ConfirmQualityFrame.Confirm.MouseButton1Click:connect(function()
- BtnClickAnim(ConfirmQualityFrame.Confirm)
- if not AnimationActive then
- AnimationActive = true
- SF.Swoosh.PlaybackSpeed = 1
- SF.Swoosh:Play()
- SettingsGUI.ConfirmQuality.Background:TweenPosition(UDim2.new(-3.5, 0, 0, DealershipGUI.MeasureMent.AbsoluteSize.Y), "Out", "Sine", 0.5, false)
- SettingsFrame.Quality.ImageColor3 = color
- SettingsFrame.Quality.down.ImageColor3 = color
- SettingsFrame.Quality.TextLabel.Text = "High"
- rF.ChangeSetting:InvokeServer(2, 2)
- wait(0.5)
- SettingsGUI.ConfirmQuality.Visible = false
- ConfirmQualityFrame.Confirm.ImageColor3 = color
- AnimationActive = false
- end
- end)
- ConfirmQualityFrame.Confirm.MouseEnter:connect(function()
- if not ButtonHover then
- ButtonHover = true
- ConfirmQualityFrame.Confirm.ImageColor3 = ConfirmQualityFrame.Confirm.HoverColor.Value
- ConfirmQualityFrame.Confirm.down.ImageColor3 = ConfirmQualityFrame.Confirm.HoverColor.Value
- SF.ButtonHover:Play()
- end
- ConfirmQualityFrame.Confirm.MouseLeave:connect(function()
- ConfirmQualityFrame.Confirm.ImageColor3 = color
- ConfirmQualityFrame.Confirm.down.ImageColor3 = color
- ButtonHover = false
- end)
- end)
- ConfirmQualityFrame.Cancel.MouseButton1Click:connect(function()
- if not AnimationActive then
- AnimationActive = true
- BtnClickAnim(ConfirmQualityFrame.Cancel)
- SF.Swoosh.PlaybackSpeed = 1
- SF.Swoosh:Play()
- SettingsGUI.ConfirmQuality.Background:TweenPosition(UDim2.new(-3.5, 0, 0, DealershipGUI.MeasureMent.AbsoluteSize.Y), "Out", "Sine", 0.5, false)
- wait(0.5)
- SettingsGUI.ConfirmQuality.Visible = false
- ConfirmQualityFrame.Cancel.ImageColor3 = CancelColor
- AnimationActive = false
- end
- end)
- ConfirmQualityFrame.Cancel.MouseEnter:connect(function()
- if not ButtonHover then
- ButtonHover = true
- ConfirmQualityFrame.Cancel.ImageColor3 = ConfirmQualityFrame.Cancel.HoverColor.Value
- ConfirmQualityFrame.Cancel.down.ImageColor3 = ConfirmQualityFrame.Cancel.HoverColor.Value
- SF.ButtonHover:Play()
- end
- ConfirmQualityFrame.Cancel.MouseLeave:connect(function()
- ConfirmQualityFrame.Cancel.ImageColor3 = CancelColor
- ConfirmQualityFrame.Cancel.down.ImageColor3 = CancelColor
- ButtonHover = false
- end)
- end)
- SettingsFrame.Speed.MouseButton1Click:connect(function()
- BtnClickAnim(SettingsFrame.Speed)
- if Settings.SpeedUnit.Value == 1 then
- if SpeedHover then
- SettingsFrame.Speed.ImageColor3 = SettingsFrame.Speed.KPHColorHover.Value
- SettingsFrame.Speed.down.ImageColor3 = SettingsFrame.Speed.KPHColorHover.Value
- else
- SettingsFrame.Speed.ImageColor3 = SettingsFrame.Speed.KPHColor.Value
- SettingsFrame.Speed.down.ImageColor3 = SettingsFrame.Speed.KPHColor.Value
- end
- SettingsFrame.Speed.TextLabel.Text = "KM/H"
- DescBg.Text1.Text = "Set the speed unit on gauges and stats to MPH"
- rF.ChangeSetting:InvokeServer(4, 2)
- else
- if SpeedHover then
- SettingsFrame.Speed.ImageColor3 = SettingsFrame.Speed.MPHColorHover.Value
- SettingsFrame.Speed.down.ImageColor3 = SettingsFrame.Speed.MPHColorHover.Value
- else
- SettingsFrame.Speed.ImageColor3 = Blue
- SettingsFrame.Speed.down.ImageColor3 = Blue
- end
- SettingsFrame.Speed.TextLabel.Text = "MPH"
- DescBg.Text1.Text = "Set the speed unit on gauges and stats to KM/H"
- rF.ChangeSetting:InvokeServer(4, 1)
- end
- end)
- SettingsFrame.Speed.MouseEnter:connect(function()
- if Settings.SpeedUnit.Value == 2 then
- SettingsFrame.Speed.ImageColor3 = SettingsFrame.Speed.KPHColorHover.Value
- SettingsFrame.Speed.down.ImageColor3 = SettingsFrame.Speed.KPHColorHover.Value
- DescBg.Text1.Text = "Set the speed unit on gauges and stats to MPH"
- else
- SettingsFrame.Speed.ImageColor3 = SettingsFrame.Speed.MPHColorHover.Value
- SettingsFrame.Speed.down.ImageColor3 = SettingsFrame.Speed.MPHColorHover.Value
- DescBg.Text1.Text = "Set the speed unit on gauges and stats to KM/H"
- end
- DescBg.Text2.Text = ""
- if not SpeedHover then
- SpeedHover = true
- SF.ButtonHover:Play()
- end
- SettingsFrame.Speed.MouseLeave:connect(function()
- if Settings.SpeedUnit.Value == 2 then
- SettingsFrame.Speed.ImageColor3 = SettingsFrame.Speed.KPHColor.Value
- SettingsFrame.Speed.down.ImageColor3 = SettingsFrame.Speed.KPHColor.Value
- else
- SettingsFrame.Speed.ImageColor3 = Blue
- SettingsFrame.Speed.down.ImageColor3 = Blue
- end
- DescBg.Text1.Text = ""
- SpeedHover = false
- end)
- end)
- SettingsFrame.Invincibility.MouseButton1Click:connect(function()
- BtnClickAnim(SettingsFrame.Invincibility)
- if InvinUnlocked then
- if not Settings.Invincibility.Value then
- if InvinHover then
- SettingsFrame.Invincibility.ImageColor3 = SettingsFrame.Invincibility.EnabledColorHover.Value
- SettingsFrame.Invincibility.down.ImageColor3 = SettingsFrame.Invincibility.EnabledColorHover.Value
- else
- SettingsFrame.Invincibility.ImageColor3 = color
- SettingsFrame.Invincibility.down.ImageColor3 = color
- end
- rF.ChangeSetting:InvokeServer(1, true)
- rF.ChangeSetting:InvokeServer(5, true)
- SettingsFrame.Invincibility.TextLabel.Text = "ON"
- DescBg.Text1.Text = "Disable character invincibility"
- else
- if InvinHover then
- SettingsFrame.Invincibility.ImageColor3 = SettingsFrame.Invincibility.DisabledColorHover.Value
- SettingsFrame.Invincibility.down.ImageColor3 = SettingsFrame.Invincibility.DisabledColorHover.Value
- else
- SettingsFrame.Invincibility.ImageColor3 = Color3.fromRGB(150, 150, 150)
- SettingsFrame.Invincibility.down.ImageColor3 = Color3.fromRGB(150, 150, 150)
- end
- rF.ChangeSetting:InvokeServer(1, false)
- rF.ChangeSetting:InvokeServer(5, false)
- SettingsFrame.Invincibility.TextLabel.Text = "OFF"
- DescBg.Text1.Text = "Enable character invincibility"
- end
- end
- end)
- SettingsFrame.Invincibility.MouseEnter:connect(function()
- if Settings.Invincibility.Value and InvinUnlocked then
- SettingsFrame.Invincibility.ImageColor3 = SettingsFrame.Invincibility.EnabledColorHover.Value
- SettingsFrame.Invincibility.down.ImageColor3 = SettingsFrame.Invincibility.EnabledColorHover.Value
- DescBg.Text1.Text = "Disable character invincibility"
- else
- SettingsFrame.Invincibility.ImageColor3 = SettingsFrame.Invincibility.DisabledColorHover.Value
- SettingsFrame.Invincibility.down.ImageColor3 = SettingsFrame.Invincibility.DisabledColorHover.Value
- if InvinUnlocked then
- DescBg.Text1.Text = "Enable character invincibility"
- else
- DescBg.Text1.Text = "[Requires Super Human gamepass to enable]"
- end
- end
- DescBg.Text2.Text = ""
- if not InvinHover then
- InvinHover = true
- SF.ButtonHover:Play()
- end
- SettingsFrame.Invincibility.MouseLeave:connect(function()
- if Settings.Invincibility.Value and InvinUnlocked then
- SettingsFrame.Invincibility.ImageColor3 = color
- SettingsFrame.Invincibility.down.ImageColor3 = color
- else
- SettingsFrame.Invincibility.ImageColor3 = Color3.fromRGB(150, 150, 150)
- SettingsFrame.Invincibility.down.ImageColor3 = Color3.fromRGB(150, 150, 150)
- end
- DescBg.Text1.Text = ""
- InvinHover = false
- end)
- end)
- SettingsFrame.Suspension.MouseButton1Click:connect(function()
- BtnClickAnim(SettingsFrame.Suspension)
- if not Settings.SusDisabled.Value then
- if SusHover then
- SettingsFrame.Suspension.ImageColor3 = SettingsFrame.Suspension.DisabledColorHover.Value
- SettingsFrame.Suspension.down.ImageColor3 = SettingsFrame.Suspension.DisabledColorHover.Value
- else
- SettingsFrame.Suspension.ImageColor3 = Color3.fromRGB(150, 150, 150)
- SettingsFrame.Suspension.down.ImageColor3 = Color3.fromRGB(150, 150, 150)
- end
- SettingsFrame.Suspension.TextLabel.Text = "Disabled"
- DescBg.Text2.Text = "Enable vehicle suspension (Slightly increases lag and reduces vehicle stability)"
- rF.ChangeSetting:InvokeServer(7, true)
- else
- if SusHover then
- SettingsFrame.Suspension.ImageColor3 = SettingsFrame.Suspension.EnabledColorHover.Value
- SettingsFrame.Suspension.down.ImageColor3 = SettingsFrame.Suspension.EnabledColorHover.Value
- else
- SettingsFrame.Suspension.ImageColor3 = color
- SettingsFrame.Suspension.down.ImageColor3 = color
- end
- SettingsFrame.Suspension.TextLabel.Text = "Enabled"
- DescBg.Text2.Text = "Disable vehicle suspension (Recommended when only crushing vehicles)"
- rF.ChangeSetting:InvokeServer(7, false)
- end
- end)
- SettingsFrame.Suspension.MouseEnter:connect(function()
- if Settings.SusDisabled.Value then
- SettingsFrame.Suspension.ImageColor3 = SettingsFrame.Suspension.DisabledColorHover.Value
- SettingsFrame.Suspension.down.ImageColor3 = SettingsFrame.Suspension.DisabledColorHover.Value
- DescBg.Text2.Text = "Enable vehicle suspension (Slightly increases lag and reduces vehicle stability)"
- else
- SettingsFrame.Suspension.ImageColor3 = SettingsFrame.Suspension.EnabledColorHover.Value
- SettingsFrame.Suspension.down.ImageColor3 = SettingsFrame.Suspension.EnabledColorHover.Value
- DescBg.Text2.Text = "Disable vehicle suspension (Recommended when only crushing vehicles)"
- end
- DescBg.Text1.Text = ""
- if not SusHover then
- SusHover = true
- SF.ButtonHover:Play()
- end
- SettingsFrame.Suspension.MouseLeave:connect(function()
- if Settings.SusDisabled.Value then
- SettingsFrame.Suspension.ImageColor3 = Color3.fromRGB(150, 150, 150)
- SettingsFrame.Suspension.down.ImageColor3 = Color3.fromRGB(150, 150, 150)
- else
- SettingsFrame.Suspension.ImageColor3 = color
- SettingsFrame.Suspension.down.ImageColor3 = color
- end
- DescBg.Text2.Text = ""
- SusHover = false
- end)
- end)
- for i, v in pairs(SpawnBtns) do
- v.MouseButton1Click:connect(function()
- BtnClickAnim(v)
- if ActiveBtn ~= v then
- v.ImageColor3 = color
- v.down.ImageColor3 = color
- ActiveBtn.ImageColor3 = CancelColor
- ActiveBtn.down.ImageColor3 = CancelColor
- ActiveBtn = v
- rF.ChangeSetting:InvokeServer(6, i)
- end
- end)
- v.MouseEnter:connect(function()
- if ActiveBtn ~= v then
- v.ImageColor3 = CancelColorHover
- v.down.ImageColor3 = CancelColorHover
- else
- v.ImageColor3 = ConfirmHover
- v.down.ImageColor3 = ConfirmHover
- end
- DescBg.Text1.Text = "Change vehicle spawnpoint to " .. v.TextLabel.Text
- DescBg.Text2.Text = ""
- if not ButtonHover then
- ButtonHover = true
- SF.ButtonHover:Play()
- end
- v.MouseLeave:connect(function()
- if ActiveBtn ~= v then
- v.ImageColor3 = CancelColor
- v.down.ImageColor3 = CancelColor
- else
- v.ImageColor3 = color
- v.down.ImageColor3 = color
- end
- DescBg.Text1.Text = ""
- ButtonHover = false
- end)
- end)
- if Settings.Spawnpoint.Value == i and ActiveBtn ~= v then
- v.ImageColor3 = color
- v.down.ImageColor3 = color
- ActiveBtn.ImageColor3 = CancelColor
- ActiveBtn.down.ImageColor3 = CancelColor
- ActiveBtn = v
- end
- end
- SettingsFrame.Transfer.MouseButton1Click:connect(function()
- if TransferEnabled then
- BtnClickAnim(SettingsFrame.Transfer)
- if not AnimationActive then
- AnimationActive = true
- SF.Swoosh.PlaybackSpeed = 1
- SF.Swoosh:play()
- Backg:TweenPosition(UDim2.new(-3.5, 0, 0, DealershipGUI.MeasureMent.AbsoluteSize.Y), "Out", "Sine", 0.5, false)
- wait(0.5)
- SettingsGUI.Settings.Visible = false
- ButtonHover = false
- wait(0.2)
- SF.Swoosh.PlaybackSpeed = 1.3
- SF.Swoosh:play()
- SettingsGUI.ConfirmTransfer.Visible = true
- SettingsGUI.ConfirmTransfer.Background:TweenPosition(UDim2.new(-3.5, 0, 0, (DealershipGUI.MeasureMent.AbsoluteSize.Y - SettingsGUI.ConfirmTransfer.Background.AbsoluteSize.Y) / 2), "In", "Sine", 0.3, false)
- wait(0.3)
- AnimationActive = false
- end
- end
- end)
- SettingsFrame.Transfer.MouseEnter:connect(function()
- local Color = SettingsFrame.Transfer.ActiveColor.Value
- if not ButtonHover and TransferEnabled then
- ButtonHover = true
- SettingsFrame.Transfer.ImageColor3 = SettingsFrame.Transfer.ActiveColorHover.Value
- SettingsFrame.Transfer.down.ImageColor3 = SettingsFrame.Transfer.ActiveColorHover.Value
- SF.ButtonHover:Play()
- end
- SettingsFrame.Transfer.MouseLeave:connect(function()
- if TransferEnabled then
- SettingsFrame.Transfer.ImageColor3 = Color
- SettingsFrame.Transfer.down.ImageColor3 = Color
- ButtonHover = false
- end
- end)
- end)
- ConfirmTransFrame.Confirm.MouseButton1Click:connect(function()
- BtnClickAnim(ConfirmTransFrame.Confirm)
- if not AnimationActive then
- AnimationActive = true
- SF.Swoosh.PlaybackSpeed = 1
- SF.Swoosh:Play()
- SF.Purchase:play()
- SettingsGUI.ConfirmTransfer.Background:TweenPosition(UDim2.new(-3.5, 0, 0, DealershipGUI.MeasureMent.AbsoluteSize.Y), "Out", "Sine", 0.5, false)
- if VehicleMenu.Menu.Visible == true or OpenVM then
- VehicleMenu.Menu.Background:TweenPosition(VMenuPos2, "Out", "Back", 0.3, false)
- delay(0.1, function()
- InUseCar = nil
- Seat = nil
- VehicleCopy = nil
- if not OpenVM then
- Cam.CameraSubject = Plr.Character.Humanoid
- Cam.CameraType = "Custom"
- Plr.CameraMaxZoomDistance = 250
- end
- View = 1
- OpenVM = false
- end)
- end
- delay(0.3, function()
- VehicleMenu.Menu.Visible = false
- end)
- rF.Transfer:InvokeServer()
- CustomDataCache = nil
- for _, v in pairs(VehicleFrames) do
- if game.ReplicatedStorage.VehicleInformation:FindFirstChild(v.Name) and v.Color.P.Text ~= "FREE" then
- if game.ReplicatedStorage.VehicleInformation:FindFirstChild(v.Name).VipOnly.Value == true then
- v.Color.BackgroundColor3 = Color3.fromRGB(72, 43, 190)
- elseif game.ReplicatedStorage.VehicleInformation:FindFirstChild(v.Name).GroupOnly.Value == true then
- v.Color.BackgroundColor3 = Color3.fromRGB(37, 114, 190)
- else
- v.Color.BackgroundColor3 = Color3.fromRGB(63, 120, 55)
- end
- end
- end
- GiveUnlockedVehicles()
- CheckBestVehicle()
- Previous = 0
- Progress.Label.Text = "Next Vehicle: " .. Rounder:ConvertAccurate(Target)
- UpdateProgress()
- MultiplyValues()
- if Dealing then
- UpdateRequirements(GetCurrentCarValue().Name)
- end
- wait(0.5)
- SettingsGUI.ConfirmTransfer.Visible = false
- ConfirmTransFrame.Confirm.ImageColor3 = color
- ButtonHover = false
- AnimationActive = false
- SettingsIsOpen = false
- end
- end)
- ConfirmTransFrame.Confirm.MouseEnter:connect(function()
- if not ButtonHover then
- ButtonHover = true
- ConfirmTransFrame.Confirm.ImageColor3 = ConfirmTransFrame.Confirm.HoverColor.Value
- ConfirmTransFrame.Confirm.down.ImageColor3 = ConfirmTransFrame.Confirm.HoverColor.Value
- SF.ButtonHover:Play()
- end
- ConfirmTransFrame.Confirm.MouseLeave:connect(function()
- ConfirmTransFrame.Confirm.ImageColor3 = color
- ConfirmTransFrame.Confirm.down.ImageColor3 = color
- ButtonHover = false
- end)
- end)
- ConfirmTransFrame.Cancel.MouseButton1Click:connect(function()
- if not AnimationActive then
- AnimationActive = true
- BtnClickAnim(ConfirmTransFrame.Cancel)
- SF.Swoosh.PlaybackSpeed = 1
- SF.Swoosh:Play()
- SettingsGUI.ConfirmTransfer.Background:TweenPosition(UDim2.new(-3.5, 0, 0, DealershipGUI.MeasureMent.AbsoluteSize.Y), "Out", "Sine", 0.5, false)
- wait(0.5)
- SettingsGUI.ConfirmTransfer.Visible = false
- ButtonHover = false
- ConfirmTransFrame.Cancel.ImageColor3 = CancelColor
- SettingsIsOpen = false
- AnimationActive = false
- end
- end)
- ConfirmTransFrame.Cancel.MouseEnter:connect(function()
- if not ButtonHover then
- ButtonHover = true
- ConfirmTransFrame.Cancel.ImageColor3 = ConfirmTransFrame.Cancel.HoverColor.Value
- ConfirmTransFrame.Cancel.down.ImageColor3 = ConfirmTransFrame.Cancel.HoverColor.Value
- SF.ButtonHover:Play()
- end
- ConfirmTransFrame.Cancel.MouseLeave:connect(function()
- ConfirmTransFrame.Cancel.ImageColor3 = CancelColor
- ConfirmTransFrame.Cancel.down.ImageColor3 = CancelColor
- ButtonHover = false
- end)
- end)
- local TutorialActive = false
- local C = {
- "C1",
- "C2",
- "C3",
- "C4",
- "C5",
- "C6",
- "C7",
- "C8",
- "C9",
- "C10",
- "C11",
- "C12"
- }
- for i, v in pairs(C) do
- C[i] = false
- end
- function typetext(text, GUI, IgnoreCommas)
- for n = 0, text:len() do
- if GUI then
- GUI.Text = text:sub(0, n)
- SF.Write:play()
- if text:sub(n, n) == "," and not IgnoreCommas then
- wait(0.2)
- else
- wait()
- end
- end
- end
- end
- Tutorial.No.MouseButton1Click:connect(function()
- BtnClickAnim(Tutorial.No)
- if not AnimationActive then
- SF.Swoosh.PlaybackSpeed = 1
- SF.Swoosh:play()
- Tutorial.Parent:TweenPosition(UDim2.new(-3.5, 0, 0, DealershipGUI.MeasureMent.AbsoluteSize.Y), "Out", "Sine", 0.5, false)
- wait(0.5)
- Tutorial.Parent.Parent.Visible = false
- AnimationActive = false
- ButtonHover = false
- end
- end)
- Tutorial.No.MouseEnter:connect(function()
- local Color = Tutorial.No.ImageColor3
- if not ButtonHover then
- ButtonHover = true
- Tutorial.No.ImageColor3 = Tutorial.No.HoverColor.Value
- Tutorial.No.down.ImageColor3 = Tutorial.No.HoverColor.Value
- SF.ButtonHover:Play()
- end
- Tutorial.No.MouseLeave:connect(function()
- Tutorial.No.ImageColor3 = Color
- Tutorial.No.down.ImageColor3 = Color
- ButtonHover = false
- end)
- end)
- Tutorial.Yes.MouseButton1Click:connect(function()
- BtnClickAnim(Tutorial.Yes)
- local StandardPos = MessagePos1
- if MobileUser then
- StandardPos = MessagePos2
- end
- if not AnimationActive and not MeltDownActive.Value then
- TutorialActive = true
- SF.Swoosh.PlaybackSpeed = 1
- SF.Swoosh:play()
- Tutorial.Parent:TweenPosition(UDim2.new(-3.5, 0, 0, DealershipGUI.MeasureMent.AbsoluteSize.Y), "Out", "Sine", 0.5, false)
- wait(0.5)
- Tutorial.Parent.Parent.Visible = false
- BScrn.ZIndex = 8
- HalfFade = true
- BScrnIn()
- HalfFade = false
- wait(0.5)
- Message.Visible = true
- Message:TweenPosition(StandardPos, "In", "Back", 0.3, false)
- wait(0.3)
- AnimationActive = false
- ButtonHover = false
- typetext("To start earning money, you're going to need a car", Message.Text)
- Message.Clk.Visible = true
- Message.Click.Visible = true
- Message.Clk.MouseButton1Click:connect(function()
- if not C[1] and not MeltDownActive.Value then
- C[1] = true
- Message.Clk.Visible = false
- Message.Click.Visible = false
- typetext("Press the dealership button and you can check out the available vehicles", Message.Text)
- if TBarHidden then
- TBarHidden = false
- HideFrame.up.Visible = true
- HideFrame.down.Visible = false
- HideFrame.Parent.menu.Visible = true
- Progress.Visible = true
- HideFrame.Parent:TweenPosition(UDim2.new(-2, 0, 0.1, 0), "In", "Back", 0.3, true)
- end
- Menu.Dealership.ZIndex = 9
- Menu.Dealership.down.ZIndex = 9
- Menu.Dealership.TextLabel.ZIndex = 10
- end
- Menu.Dealership.MouseButton1Click:connect(function()
- if not C[2] and not MeltDownActive.Value then
- C[2] = true
- BScrn.ZIndex = 10
- Menu.Dealership.ZIndex = 1
- Menu.Dealership.down.ZIndex = 1
- Menu.Dealership.TextLabel.ZIndex = 2
- Message.Text.Text = ""
- Message.Position = UDim2.new(0.5, -Message.AbsoluteSize.X / 2, 1, 0)
- ExitDisabled = true
- SideBar.Exit.ImageColor3 = SideBar.Exit.DisabledColor.Value
- SideBar.Exit.HoverLabel.Text = "Unavailable"
- SpawnDisabled = true
- Holder.Spawn.ImageColor3 = Holder.Spawn.DisabledColor.Value
- repeat
- wait()
- until not Fading
- Message:TweenPosition(MessagePos2, "In", "Back", 0.5, false)
- wait(0.7)
- typetext("This is where you spawn your unlocked vehicles", Message.Text)
- Message.Clk.Visible = true
- Message.Click.Visible = true
- end
- Message.Clk.MouseButton1Click:connect(function()
- if not C[3] and not MeltDownActive.Value then
- C[3] = true
- Message.Clk.Visible = false
- Message.Click.Visible = false
- Message.Text.Text = ""
- typetext("Once you get enough money for a vehicle it will unlock automatically,", Message.Text1)
- typetext("and you'll be able to spawn it how many times you want", Message.Text2)
- Message.Clk.Visible = true
- Message.Click.Visible = true
- end
- Message.Clk.MouseButton1Click:connect(function()
- if not C[4] and not MeltDownActive.Value then
- C[4] = true
- Message.Clk.Visible = false
- Message.Click.Visible = false
- Message.Text2.Text = ""
- Holder.Next.ZIndex = 9
- Holder.Next.down.ZIndex = 9
- Holder.Next.ImageLabel.ZIndex = 10
- Holder.Previous.ZIndex = 9
- Holder.Previous.down.ZIndex = 9
- Holder.Previous.ImageLabel.ZIndex = 10
- BScrnIn2()
- typetext("You can scroll between vehicles by", Message.Text1)
- typetext("using the arrows below", Message.Text2)
- Message.Clk.Visible = true
- Message.Click.Visible = true
- end
- Message.Clk.MouseButton1Click:connect(function()
- if not C[5] and not MeltDownActive.Value then
- C[5] = true
- Message.Clk.Visible = false
- Message.Click.Visible = false
- Message.Text2.Text = ""
- Holder.Next.ZIndex = 1
- Holder.Next.down.ZIndex = 1
- Holder.Next.ImageLabel.ZIndex = 2
- Holder.Previous.ZIndex = 1
- Holder.Previous.down.ZIndex = 1
- Holder.Previous.ImageLabel.ZIndex = 2
- DTbar.ZIndex = 9
- for _, v in pairs(DTbar.VehicleBar:GetChildren()) do
- if v:IsA("Frame") then
- v.ZIndex = 9
- v.ImageButton.ZIndex = 9
- v.Click.ZIndex = 10
- v.Color.ZIndex = 9
- v.Color.P.ZIndex = 9
- end
- end
- if not MobileUser then
- typetext("Or if you want to go to a specific vehicle faster, you can scroll", Message.Text1)
- typetext("in the vehicle wheel and click on the vehicle you want to go to", Message.Text2)
- else
- typetext("Or if you want to go to a specific vehicle faster, you can swipe", Message.Text1)
- typetext("in the vehicle wheel and tap on the vehicle you want to go to.", Message.Text2)
- end
- Message.Clk.Visible = true
- Message.Click.Visible = true
- end
- Message.Clk.MouseButton1Click:connect(function()
- if not C[6] and not MeltDownActive.Value then
- C[6] = true
- Message.Clk.Visible = false
- Message.Click.Visible = false
- Message.Text1.Text = ""
- Message.Text2.Text = ""
- BScrnOut2()
- DTbar.ZIndex = 1
- for _, v in pairs(DTbar.VehicleBar:GetChildren()) do
- if v:IsA("Frame") then
- v.ZIndex = 1
- v.ImageButton.ZIndex = 1
- v.Click.ZIndex = 2
- v.Color.ZIndex = 1
- v.Color.P.ZIndex = 1
- end
- end
- typetext("You can also customize your unlocked vehicles by pressing", Message.Text1)
- typetext("the customize button on a vehicle's stat display", Message.Text2)
- Message.Clk.Visible = true
- Message.Click.Visible = true
- end
- Message.Clk.MouseButton1Click:connect(function()
- if not C[7] and not MeltDownActive.Value then
- C[7] = true
- Message.Clk.Visible = false
- Message.Click.Visible = false
- Message.Text2.Text = ""
- typetext("When you're done with your vehicle,", Message.Text1)
- wait(0.1)
- typetext("just press the spawn button and you can start crushing it", Message.Text2)
- SpawnDisabled = false
- if not SpawnDisabled2 then
- Holder.Spawn.ImageColor3 = color
- Holder.Spawn.down.ImageColor3 = color
- end
- end
- Holder.Spawn.MouseButton1Click:connect(function()
- if not C[8] and not SpawnDisabled2 and not MeltDownActive.Value then
- C[8] = true
- Message.Position = UDim2.new(0.5, -Message.AbsoluteSize.X / 2, 1, 0)
- Message.Text2.Text = ""
- Message.Text1.Text = ""
- wait(0.5)
- repeat
- wait()
- until not Fading
- ExitDisabled = false
- SideBar.Exit.ImageColor3 = ExitColor
- SideBar.Exit.HoverLabel.Text = "Exit"
- Message:TweenPosition(StandardPos, "In", "Back", 0.3, false)
- wait(0.5)
- typetext("You will unlock new crushers as you progress in the game,", Message.Text1)
- wait(0.1)
- typetext("but you can use all the crushers in row 1 right away", Message.Text2)
- Message.Clk.Visible = true
- Message.Click.Visible = true
- end
- Message.Clk.MouseButton1Click:connect(function()
- if not C[9] and not MeltDownActive.Value then
- C[9] = true
- Message.Clk.Visible = false
- Message.Click.Visible = false
- Message.Text2.Text = ""
- typetext("Some crushers have quick-enable buttons that will", Message.Text1)
- typetext("automatically enable everything in the crusher", Message.Text2)
- Message.Clk.Visible = true
- Message.Click.Visible = true
- end
- Message.Clk.MouseButton1Click:connect(function()
- if not C[10] and not MeltDownActive.Value then
- C[10] = true
- Message.Clk.Visible = false
- Message.Click.Visible = false
- Message.Text2.Text = ""
- typetext("But all of them have a control room to the right of the vehicle", Message.Text1)
- typetext("entrance where you can control how the crusher behaves", Message.Text2)
- Message.Clk.Visible = true
- Message.Click.Visible = true
- end
- Message.Clk.MouseButton1Click:connect(function()
- if not C[11] and not MeltDownActive.Value then
- C[11] = true
- Message.Clk.Visible = false
- Message.Click.Visible = false
- Message.Text2.Text = ""
- if not MobileUser then
- typetext("Just hover your mouse over any control there", Message.Text1)
- else
- typetext("Just walk near any control there", Message.Text1)
- end
- typetext("and you'll see a label of what it does", Message.Text2)
- Message.Clk.Visible = true
- Message.Click.Visible = true
- end
- Message.Clk.MouseButton1Click:connect(function()
- if not C[12] and not MeltDownActive.Value then
- C[12] = true
- Message.Clk.Visible = false
- Message.Click.Visible = false
- Message.Text1.Text = ""
- Message.Text2.Text = ""
- typetext("That's all for the tutorial, good luck crushing!", Message.Text)
- wait(2)
- Message:TweenPosition(UDim2.new(0.5, -Message.AbsoluteSize.X / 2, 1, 0), "Out", "Back", 0.3, false)
- wait(0.3)
- Message.Visible = false
- TutorialActive = false
- end
- end)
- end)
- end)
- end)
- end)
- end)
- end)
- end)
- end)
- end)
- end)
- end)
- end
- end)
- rE.MeltDown.OnClientEvent:connect(function(Name, Players)
- if Name then
- Music.Value = 0
- if Tutorial.Parent.Parent.Visible == true then
- SF.Swoosh.PlaybackSpeed = 1
- SF.Swoosh:play()
- Tutorial.Parent:TweenPosition(UDim2.new(-3.5, 0, 0, DealershipGUI.MeasureMent.AbsoluteSize.Y), "Out", "Sine", 0.5, false)
- delay(0.5, function()
- Tutorial.Parent.Parent.Visible = false
- end)
- end
- local GUI = Message
- if TutorialActive then
- local Folder = Instance.new("Folder", Plr)
- Folder.Name = "ResumeTutorial"
- Message.Clk:Destroy()
- Message.Click:Destroy()
- local Clone = Message:Clone()
- for _, v in pairs(Clone:GetChildren()) do
- if v:IsA("GuiObject") then
- v.Text = ""
- end
- end
- Clone.Parent = Message.Parent
- Message:Destroy()
- GUI = Clone
- end
- GUI.Visible = true
- if not Dealing and not MobileUser then
- GUI:TweenPosition(MessagePos1, "In", "Back", 0.3, false)
- else
- GUI:TweenPosition(MessagePos2, "In", "Back", 0.3, false)
- end
- typetext(Name[1] .. " has activated the energy core self-destruct sequence.", GUI.Text)
- wait(1)
- GUI.Text.Text = ""
- typetext("An escape helicopter has landed somewhere " .. Name[2] .. ",", GUI.Text1)
- typetext("find it and escape to survive the facility explosion.", GUI.Text2)
- wait(1)
- GUI.Text1.Text = ""
- GUI.Text2.Text = ""
- local Money = 0
- if Plr.Money.Value > 5000000000 then
- if Plr:FindFirstChild("CoreAccess") then
- Money = math.min(Plr.Money.Value * 0.25, 100000000000)
- else
- Money = math.min(Plr.Money.Value * 0.15, 100000000000)
- end
- elseif Plr:FindFirstChild("CoreAccess") then
- Money = 5000 + Plr.Money.Value * 0.4
- else
- Money = 5000 + Plr.Money.Value * 0.25
- end
- typetext("You will earn " .. Rounder:ConvertAccurate(Rounder:RoundOff(Money)) .. " Money if you survive.", GUI.Text, true)
- wait(1)
- if TutorialActive then
- rE.RefreshCharacter:FireServer()
- end
- else
- Message.Visible = true
- Message:TweenPosition(MessagePos1, "In", "Back", 0.3, false)
- wait(0.5)
- typetext("The facility has been destroyed and will regenerate shortly.", Message.Text1)
- wait(0.2)
- if #Players == 0 then
- typetext("Nobody survived the explosion!", Message.Text2)
- elseif #Players == #game.Players:GetChildren() then
- typetext("Everyone survived the explosion!", Message.Text2)
- elseif #Players == 1 then
- typetext("Only " .. Players[1] .. " Survived the explosion!", Message.Text2)
- elseif #Players == 2 then
- typetext("Only " .. Players[1] .. " and " .. Players[2] .. " Survived!", Message.Text2)
- elseif #Players == 3 then
- typetext(Players[1] .. ", " .. Players[2] .. " and " .. Players[3] .. " Survived!", Message.Text2, true)
- elseif #Players == 4 then
- typetext(Players[1] .. ", " .. Players[2] .. ", " .. Players[3] .. " and " .. Players[4] .. " Survived!", Message.Text2, true)
- else
- typetext("Almost everyone survived the explosion!")
- end
- wait(1.5)
- BScrnIn()
- BScrn.Text = "Regenerating"
- while wait(0.4) do
- if BScrn.Text:len() == 15 then
- BScrn.Text = "Regenerating"
- else
- BScrn.Text = BScrn.Text .. "."
- end
- end
- end
- end)
- rE.CountDown.OnClientEvent:connect(function(Number)
- if Message then
- if not Message.Visible then
- Message.Visible = true
- if MobileUser then
- Message:TweenPosition(MessagePos2, "In", "Back", 0.3, false)
- else
- Message:TweenPosition(MessagePos1, "In", "Back", 0.3, false)
- end
- end
- if Number then
- Message.Text.Text = "Facility about to explode, the escape helicopter is leaving in " .. Number .. " seconds!"
- else
- Message.Text.Text = "Escape helicopter is leaving!"
- wait(1.5)
- Message:TweenPosition(UDim2.new(0.5, -Message.AbsoluteSize.X / 2, 1, 0), "Out", "Back", 0.3, false)
- TBar.Holder:TweenPosition(UDim2.new(-2, 0, -1.79, 0), "Out", "Back", 0.3, false)
- if VehicleMenu.Menu.Visible then
- VehicleMenu.Menu.Background:TweenPosition(VMenuPos2, "Out", "Back", 0.3, false)
- end
- if View == 2 then
- Cam.CameraSubject = Plr.Character.Humanoid
- Cam.CameraType = "Custom"
- Plr.CameraMaxZoomDistance = 250
- end
- wait(0.3)
- Message.Text.Text = ""
- Message.Visible = false
- VehicleMenu.Menu.Visible = false
- TBar.Holder.hide.Visible = false
- TBar.Holder.Progress.Visible = false
- repeat
- wait()
- until not Fading
- if Dealing then
- ExitDealership(true)
- end
- end
- end
- end)
- rE.Rotor.OnClientEvent:connect(function(Helicopter)
- local Event
- local Rotate = Helicopter.Heli.Rotor.WeldTo
- local AttachedTo = Helicopter.Heli.Main.MainRotorJoint
- local Angle = 0
- local Add = 0
- Rotate.Anchored = false
- Event = game:GetService("RunService").RenderStepped:Connect(function()
- if Helicopter.Parent == nil then
- Event:Disconnect()
- else
- Angle = Angle + Add
- Rotate.CFrame = AttachedTo.CFrame * CFrame.Angles(0, math.rad(Angle), 0)
- Rotate.CFrame = Rotate.CFrame * CFrame.new(0, -1.8, 0)
- end
- end)
- for i = 1, 20 do
- wait(0.1)
- Add = i
- end
- end)
- Tutorial.Yes.MouseEnter:connect(function()
- if not ButtonHover then
- ButtonHover = true
- Tutorial.Yes.ImageColor3 = Tutorial.Yes.HoverColor.Value
- Tutorial.Yes.down.ImageColor3 = Tutorial.Yes.HoverColor.Value
- SF.ButtonHover:Play()
- end
- Tutorial.Yes.MouseLeave:connect(function()
- Tutorial.Yes.ImageColor3 = color
- Tutorial.Yes.down.ImageColor3 = color
- ButtonHover = false
- end)
- end)
- if Plr:FindFirstChild("Spin") then
- do
- local Spin, Conveyor, Controls = Plr.Spin, Plr.Conveyor, Plr.Controls
- function MakeSelectionBox(parent)
- local SG = Instance.new("SelectionBox")
- SG.Color3 = Color3.new(1, 1, 1)
- SG.LineThickness = 0.015
- SG.Adornee = parent
- SG.Parent = PlrGui
- return SG
- end
- function AddHint(Control)
- local SG = MakeSelectionBox(Control)
- local Clicked = false
- local Click
- Click = Control.ClickDetector.MouseClick:connect(function()
- Clicked = true
- end)
- local B = Control.BillboardGui:Clone()
- B.Name = Control.Parent.Name .. Control.Name
- B.Parent = Plr.PlayerGui
- B.Adornee = Control
- repeat
- SG.Transparency = 0
- B.Enabled = true
- wait(0.35)
- SG.Transparency = 1
- B.Enabled = false
- wait(0.35)
- until Clicked or Control.ClickDetector.MaxActivationDistance ~= 20
- SG:Destroy()
- B:Destroy()
- Click:Disconnect()
- end
- function AddHints(Controls, String)
- local Middle = Controls[2]
- local Clicked = false
- local SGs = {}
- for _, Control in pairs(Controls) do
- do
- local SG = MakeSelectionBox(Control)
- table.insert(SGs, SG)
- local Click
- Click = Control.ClickDetector.MouseClick:connect(function()
- Clicked = true
- end)
- spawn(function()
- repeat
- wait(0.1)
- until Clicked
- SG:Destroy()
- Click:Disconnect()
- end)
- end
- end
- local B = Middle.BillboardGui:Clone()
- B.Name = "Tutorial"
- B.TextLabel.Text = String
- B.Size = UDim2.new(2, 0, 1.5, 0)
- B.StudsOffset = Vector3.new(0, 1.5, 0)
- B.Parent = Plr.PlayerGui
- B.Adornee = Middle
- repeat
- for _, SG in pairs(SGs) do
- SG.Transparency = 0
- end
- B.Enabled = true
- wait(0.35)
- for _, SG in pairs(SGs) do
- SG.Transparency = 1
- end
- B.Enabled = false
- wait(0.35)
- until Clicked or Middle.ClickDetector.MaxActivationDistance ~= 20
- B:Destroy()
- end
- for _, v in pairs(workspace["All crushers"]:GetChildren()) do
- if v:FindFirstChild("Conveyor") then
- v.Enable.Button.ClickDetector.MouseClick:connect(function()
- if v.Enable.Indicator.BrickColor == BrickColor.new("Really red") then
- if v:FindFirstChild("Spin") and not Spin.Value then
- AddHints({
- v.Spin.Slow,
- v.Spin.Medium,
- v.Spin.Fast
- }, "Adjust Spin Speed")
- if v.Spin.Enable.ClickDetector.MaxActivationDistance == 20 and v.Spin.Enable.Enabled.Value == false then
- Spin.Value = true
- AddHint(v.Spin.Enable)
- end
- end
- wait(0.2)
- if v.Conveyor.Enable.ClickDetector.MaxActivationDistance == 20 and not Conveyor.Value then
- AddHints({
- v.Conveyor.Slow,
- v.Conveyor.Medium,
- v.Conveyor.Fast
- }, "Adjust Conveyor Speed")
- if v.Conveyor.Enable.ClickDetector.MaxActivationDistance == 20 and v.Conveyor.Enable.Enabled.Value == false then
- Conveyor.Value = true
- AddHint(v.Conveyor.Enable)
- end
- end
- if v:FindFirstChild("Controls") and v.Controls.Enable.Indicator.BrickColor == BrickColor.new("Really red") and v.Name ~= "Washing Machine" and not Controls.Value then
- Controls.Value = true
- AddHint(v.Controls.Enable)
- end
- end
- end)
- end
- end
- end
- end
- for _, Frame in pairs(PlrGui:WaitForChild("GamepassShop"):WaitForChild("ScrollingFrame"):GetChildren()) do
- Frame:WaitForChild("TextButton").MouseButton1Click:Connect(function()
- local GPNum = Frame.Name:sub(9)
- MP:PromptPurchase(Plr, Gpasses[tonumber(GPNum)])
- end)
- end
- for _, Frame in pairs(PlrGui:WaitForChild("MoneyShop"):WaitForChild("ScrollingFrame"):GetChildren()) do
- Frame.TextButton.MouseButton1Click:Connect(function()
- local GPNum = Frame.Name:sub(6)
- MP:PromptProductPurchase(Plr, MoneyProducts[tonumber(GPNum)])
- end)
- end
- MP.PromptPurchaseFinished:Connect(function(player, assetId, isPurchased)
- if isPurchased then
- if assetId == Gpasses[1] then
- for _, BuyColor in pairs(CustScroll:GetChildren()) do
- if BuyColor.Name == "PremiumColor" then
- BuyColor.LockImage.Visible = false
- end
- end
- LockButton("Gamepass1")
- elseif assetId == Gpasses[2] then
- rE.GamepassItem:FireServer("Crowbar")
- LockButton("Gamepass2")
- elseif assetId == Gpasses[3] then
- CustScroll.Neon.LockImage.Visible = false
- LockButton("Gamepass3")
- elseif assetId == Gpasses[4] then
- CustScroll.Silver.LockImage.Visible = false
- LockButton("Gamepass4")
- elseif assetId == Gpasses[5] then
- if VL then
- VL:Destroy()
- VL = false
- end
- rE.GamepassItem:FireServer("Tag")
- LockButton("Gamepass5")
- wait(0.5)
- for i, v in pairs(VList) do
- if game.ReplicatedStorage.VehicleInformation[v].VipOnly.Value == true then
- local Result, Afforded = rF.PurchVehicle:InvokeServer(v, true)
- local Price = game.ReplicatedStorage.VehicleInformation:FindFirstChild(VList[i]).Price.Value
- if Result == "Bought" then
- if Dealing then
- ListFrameBack.VehicleList:FindFirstChild(v).Color.BackgroundColor3 = Color3.fromRGB(109, 61, 255)
- DTbar.VehicleBar:FindFirstChild(v).Color.BackgroundColor3 = Color3.fromRGB(109, 61, 255)
- else
- AddNotification(i)
- end
- if Price > Previous then
- Previous = Price
- end
- elseif Result == "Low Cash" and (Target == false or Target and Price < Target) then
- Target = Price
- break
- elseif Result == "Low Tokens" then
- break
- end
- end
- end
- if Target then
- Progress.Label.Text = "Next Vehicle: " .. Rounder:ConvertAccurate(Target)
- else
- Progress.Label.Text = "Max"
- end
- UpdateProgress()
- if Dealing and 1 <= #Cam:GetChildren() then
- UpdateRequirements(GetCurrentCarValue().Name)
- end
- elseif assetId == Gpasses[6] then
- SettingsFrame.Invincibility.ImageColor3 = color
- SettingsFrame.Invincibility.down.ImageColor3 = color
- SettingsFrame.Invincibility.TextLabel.Text = "ON"
- InvinUnlocked = true
- rF.ChangeSetting:InvokeServer(1, true)
- rF.ChangeSetting:InvokeServer(5, true)
- rE.Speed:FireServer(32)
- LockButton("Gamepass6")
- elseif assetId == Gpasses[7] then
- rE.GamepassItem:FireServer("Folder")
- if workspace.CrusherCovers:FindFirstChild("PremiumLine") then
- workspace.CrusherCovers.PremiumLine:Destroy()
- end
- LockButton("Gamepass7")
- elseif assetId == Gpasses[8] then
- rE.GamepassItem:FireServer("Tag2")
- if EC then
- EC:Destroy()
- EC = false
- end
- LockButton("Gamepass8")
- elseif assetId == Gpasses[9] then
- CustScroll.Gold.LockImage.Visible = false
- LockButton("Gamepass9")
- elseif assetId == Gpasses[10] then
- CustScroll.Platinum.LockImage.Visible = false
- LockButton("Gamepass10")
- end
- end
- end)
- local VMenuBack2 = VehicleMenu.Menu.Background.Background
- local TeleportDebounce = false
- local TeleportHover = false
- local RespawnDebounce = false
- local RespawnHover = false
- local FlipDebounce = false
- local RespawnColor = VMenuBack2.Respawn.ImageColor3
- function CamGuiToggle()
- if View == 2 then
- View = 1
- if not Plr.Character.Humanoid.Sit then
- Cam.CameraSubject = Plr.Character.Humanoid
- end
- VMenuBack2.CameraLabel.Text = VMenuBack2.CameraLabel.DisabledText.Value
- elseif View == 1 then
- View = 2
- if not Plr.Character.Humanoid.Sit then
- Cam.CameraSubject = Seat
- Cam.CFrame = Seat.CFrame
- end
- VMenuBack2.CameraLabel.Text = VMenuBack2.CameraLabel.EnabledText.Value
- end
- end
- VMenuBack2.Camera.MouseButton1Click:connect(function()
- BtnClickAnim(VMenuBack2.Camera)
- CamGuiToggle()
- end)
- VMenuBack2.Camera.MouseEnter:connect(function()
- if not ButtonHover then
- ButtonHover = true
- VMenuBack2.Camera.ImageColor3 = VMenuBack2.Camera.HoverColor.Value
- VMenuBack2.Camera.down.ImageColor3 = VMenuBack2.Camera.HoverColor.Value
- SF.ButtonHover:Play()
- end
- VMenuBack2.Camera.MouseLeave:connect(function()
- VMenuBack2.Camera.ImageColor3 = color
- VMenuBack2.Camera.down.ImageColor3 = color
- ButtonHover = false
- end)
- end)
- VMenuBack2.Delete.MouseButton1Click:connect(function()
- BtnClickAnim(VMenuBack2.Delete)
- if not AnimationActive then
- AnimationActive = true
- SF.Delete:play()
- if game.Workspace.CarCollection:FindFirstChild(Plr.Name) then
- rE.Delete:FireServer(game.Workspace.CarCollection:FindFirstChild(Plr.Name))
- end
- InUseCar = nil
- Seat = nil
- VehicleCopy = nil
- Cam.CameraSubject = Plr.Character.Humanoid
- Cam.CameraType = "Custom"
- Plr.CameraMaxZoomDistance = 250
- View = 1
- VMenuBack2.Parent:TweenPosition(VMenuPos2, "Out", "Back", 0.3, false)
- wait(0.3)
- VMenuBack2.Parent.Parent.Visible = false
- AnimationActive = false
- end
- end)
- VMenuBack2.Delete.MouseEnter:connect(function()
- if not ButtonHover then
- ButtonHover = true
- VMenuBack2.Delete.ImageColor3 = VMenuBack2.Delete.HoverColor.Value
- VMenuBack2.Delete.down.ImageColor3 = VMenuBack2.Delete.HoverColor.Value
- SF.ButtonHover:Play()
- end
- VMenuBack2.Delete.MouseLeave:connect(function()
- VMenuBack2.Delete.ImageColor3 = ExitColor
- VMenuBack2.Delete.down.ImageColor3 = ExitColor
- ButtonHover = false
- end)
- end)
- function Flip()
- if not FlipDebounce then
- FlipDebounce = true
- SF.Flip:play()
- if game.Workspace.CarCollection:FindFirstChild(Plr.Name) then
- rE.CreateInstance:FireServer("FlipMovers", nil, Seat, nil)
- end
- wait(2)
- FlipDebounce = false
- end
- end
- VMenuBack2.Flip.MouseButton1Click:connect(function()
- BtnClickAnim(VMenuBack2.Flip)
- Flip()
- end)
- VMenuBack2.Flip.MouseEnter:connect(function()
- if not ButtonHover then
- ButtonHover = true
- VMenuBack2.Flip.ImageColor3 = VMenuBack2.Flip.HoverColor.Value
- VMenuBack2.Flip.down.ImageColor3 = VMenuBack2.Flip.HoverColor.Value
- SF.ButtonHover:Play()
- end
- VMenuBack2.Flip.MouseLeave:connect(function()
- VMenuBack2.Flip.ImageColor3 = color
- VMenuBack2.Flip.down.ImageColor3 = color
- ButtonHover = false
- end)
- end)
- VMenuBack2.Respawn.MouseButton1Click:connect(function()
- BtnClickAnim(VMenuBack2.Respawn)
- local c = game.Workspace.CarCollection:FindFirstChild(Plr.Name)
- if not RespawnDebounce and not AnimationActive then
- AnimationActive = true
- delay(30, function()
- RespawnDebounce = false
- if RespawnHover then
- VMenuBack2.Respawn.ImageColor3 = VMenuBack2.Respawn.HoverColor.Value
- VMenuBack2.Respawn.down.ImageColor3 = VMenuBack2.Respawn.HoverColor.Value
- else
- VMenuBack2.Respawn.ImageColor3 = RespawnColor
- VMenuBack2.Respawn.down.ImageColor3 = RespawnColor
- end
- end)
- local Changing = false
- if Music.Value == 3 then
- repeat
- wait()
- until not ChangingMusic.Value
- Music.Value = 0
- ChangingMusic.Value = true
- Changing = true
- end
- BScrnIn()
- SF.Spawn:play()
- RespawnDebounce = true
- VMenuBack2.Respawn.ImageColor3 = VMenuBack2.Respawn.DisabledColor.Value
- VMenuBack2.Respawn.down.ImageColor3 = VMenuBack2.Respawn.DisabledColor.Value
- RespawnHover = false
- local Parts = rF.SpawnVehicle:InvokeServer(VehicleCopy.Name, rF.LoadSaveCustoms:InvokeServer("Load", nil, VehicleCopy.Name), true)
- for _, v in pairs(Parts) do
- v.CanCollide = false
- end
- Parts = nil
- InUseCar = game.Workspace.CarCollection:FindFirstChild(Plr.Name)
- Seat = InUseCar.Car.Body.VehicleSeat
- VMenuBack2.Teleport.ImageColor3 = color
- VMenuBack2.Teleport.down.ImageColor3 = color
- Cam.CameraSubject = Plr.Character.Humanoid
- Cam.CameraType = "Custom"
- Plr.CameraMaxZoomDistance = 250
- View = 1
- VMenuBack2.CameraLabel.Text = VMenuBack2.CameraLabel.DisabledText.Value
- local val = Instance.new("NumberValue")
- val.Parent = Seat
- val.Name = "Music"
- val.Value = 1
- Seat.Touched:connect(SeatTouched)
- Seat.ChildAdded:connect(SeatAdded)
- Seat.ChildRemoved:connect(SeatRemoved)
- wait(0.5)
- rE.TeleportPlr:FireServer("VehicleSeat")
- Music.Value = 1
- BScrnOut()
- if Changing then
- ChangingMusic.Value = false
- end
- AnimationActive = false
- end
- end)
- VMenuBack2.Respawn.MouseEnter:connect(function()
- if RespawnDebounce then
- VMenuBack2.Respawn.ImageColor3 = VMenuBack2.Respawn.DisabledColorHover.Value
- VMenuBack2.Respawn.down.ImageColor3 = VMenuBack2.Respawn.DisabledColorHover.Value
- else
- VMenuBack2.Respawn.ImageColor3 = VMenuBack2.Respawn.HoverColor.Value
- VMenuBack2.Respawn.down.ImageColor3 = VMenuBack2.Respawn.HoverColor.Value
- end
- if not RespawnHover then
- RespawnHover = true
- SF.ButtonHover:Play()
- end
- VMenuBack2.Respawn.MouseLeave:connect(function()
- if RespawnDebounce then
- VMenuBack2.Respawn.ImageColor3 = VMenuBack2.Respawn.DisabledColor.Value
- VMenuBack2.Respawn.down.ImageColor3 = VMenuBack2.Respawn.DisabledColor.Value
- else
- VMenuBack2.Respawn.ImageColor3 = RespawnColor
- VMenuBack2.Respawn.down.ImageColor3 = RespawnColor
- end
- RespawnHover = false
- end)
- end)
- spawn(function()
- while wait(0.2) do
- if Seat and Seat.Disabled == true then
- if TeleportHover then
- VMenuBack2.Teleport.ImageColor3 = VMenuBack2.Teleport.DisabledColorHover.Value
- VMenuBack2.Teleport.down.ImageColor3 = VMenuBack2.Teleport.DisabledColorHover.Value
- else
- VMenuBack2.Teleport.ImageColor3 = VMenuBack2.Teleport.DisabledColor.Value
- VMenuBack2.Teleport.down.ImageColor3 = VMenuBack2.Teleport.DisabledColor.Value
- end
- end
- end
- end)
- VMenuBack2.Teleport.MouseButton1Click:connect(function()
- BtnClickAnim(VMenuBack2.Teleport)
- if not TeleportDebounce and not AnimationActive and not Seat.Disabled then
- AnimationActive = true
- delay(10, function()
- TeleportDebounce = false
- if Seat then
- if not Seat.Disabled then
- if TeleportHover then
- VMenuBack2.Teleport.ImageColor3 = VMenuBack2.Teleport.HoverColor.Value
- VMenuBack2.Teleport.down.ImageColor3 = VMenuBack2.Teleport.HoverColor.Value
- else
- VMenuBack2.Teleport.ImageColor3 = color
- VMenuBack2.Teleport.down.ImageColor3 = color
- end
- end
- else
- VMenuBack2.Teleport.ImageColor3 = color
- VMenuBack2.Teleport.down.ImageColor3 = color
- end
- end)
- local Changing1 = false
- local Changing2 = false
- if Seat ~= nil and Seat:FindFirstChild("Music") then
- local val = Seat.Music.Value
- if (Music.Value == 1 or Music.Value == 3) and val == 0 then
- Changing1 = true
- ChangingMusic.Value = true
- Music.Value = 0
- elseif (Music.Value == 0 or Music.Value == 3) and val == 1 then
- Changing2 = true
- ChangingMusic.Value = true
- Music.Value = 0
- end
- end
- BScrnIn()
- TeleportDebounce = true
- VMenuBack2.Teleport.ImageColor3 = VMenuBack2.Teleport.DisabledColor.Value
- VMenuBack2.Teleport.down.ImageColor3 = VMenuBack2.Teleport.DisabledColor.Value
- TeleportHover = false
- rE.TeleportPlr:FireServer("VehicleSeat")
- if Changing2 then
- Music.Value = 1
- end
- BScrnOut()
- if Changing1 or Changing2 then
- ChangingMusic.Value = false
- end
- AnimationActive = false
- end
- end)
- VMenuBack2.Teleport.MouseEnter:connect(function()
- if Seat then
- if TeleportDebounce or Seat.Disabled then
- VMenuBack2.Teleport.ImageColor3 = VMenuBack2.Teleport.DisabledColorHover.Value
- VMenuBack2.Teleport.down.ImageColor3 = VMenuBack2.Teleport.DisabledColorHover.Value
- else
- VMenuBack2.Teleport.ImageColor3 = VMenuBack2.Teleport.HoverColor.Value
- VMenuBack2.Teleport.down.ImageColor3 = VMenuBack2.Teleport.HoverColor.Value
- end
- if not TeleportHover then
- TeleportHover = true
- SF.ButtonHover:Play()
- end
- VMenuBack2.Teleport.MouseLeave:connect(function()
- if TeleportDebounce or Seat.Disabled then
- VMenuBack2.Teleport.ImageColor3 = VMenuBack2.Teleport.DisabledColor.Value
- VMenuBack2.Teleport.down.ImageColor3 = VMenuBack2.Teleport.DisabledColor.Value
- else
- VMenuBack2.Teleport.ImageColor3 = color
- VMenuBack2.Teleport.down.ImageColor3 = color
- end
- TeleportHover = false
- end)
- end
- end)
- local VMHidden = false
- VMenuBack2.Parent.Hide.ClickBox.MouseButton1Click:connect(function()
- if not AnimationActive then
- AnimationActive = true
- SF.ButtonClick2D:play()
- if VMHidden then
- VMHidden = false
- VMenuBack2.Parent.Hide.Hide.Visible = true
- VMenuBack2.Parent.Hide.Show.Visible = false
- VMenuBack2.Parent:TweenPosition(VMenuPos1, "In", "Back", 0.3, true)
- else
- VMHidden = true
- VMenuBack2.Parent.Hide.Show.Visible = true
- VMenuBack2.Parent.Hide.Hide.Visible = false
- VMenuBack2.Parent:TweenPosition(VMenuPos2, "Out", "Back", 0.3, true)
- end
- wait(0.3)
- AnimationActive = false
- end
- end)
- repeat
- wait()
- until Plr.Character.Humanoid
- Plr.Character.Humanoid.Died:Connect(function()
- script.Disabled = true
- wait()
- script:Destroy()
- end)
- local Typing = false
- US.TextBoxFocused:Connect(function()
- Typing = true
- US.TextBoxFocusReleased:wait()
- Typing = false
- end)
- US.InputBegan:Connect(function(Pressed)
- if not Typing and Seat and VehicleMenu.Menu.Visible then
- if Pressed.KeyCode == Enum.KeyCode.V then
- CamGuiToggle()
- elseif Pressed.KeyCode == Enum.KeyCode.F then
- Flip()
- end
- end
- end)
- rE.ChangeBrightness.OnClientEvent:connect(function(Explosion)
- if not Explosion then
- game.Lighting.ColorCorrection.Brightness = 0.4
- wait(0.5)
- for i = 1, 100 do
- game.Lighting.ColorCorrection.Brightness = game.Lighting.ColorCorrection.Brightness - 0.004
- wait()
- end
- else
- BScrn.BackgroundColor3 = Color3.fromRGB(255, 202, 95)
- BScrn.Visible = true
- for i = 1, 20 do
- BScrn.BackgroundTransparency = BScrn.BackgroundTransparency - 0.05
- wait(0.1)
- end
- end
- end)
- local Crash1 = workspace["All crushers"]["Speed Crash Test"]
- local Crash2 = workspace["All crushers"]["Tilted speed crash test"]
- local Active = 1
- local CrashTestDebounce = false
- function R3(Position, Size)
- local SizeOffset = Size / 2
- local Point1 = Position - SizeOffset
- local Point2 = Position + SizeOffset
- return Region3.new(Point1, Point2)
- end
- Crash1.ChangeDistance.OnClientEvent:connect(function(num)
- if num == 2 then
- if Active == 1 then
- Crash1.Wall:SetPrimaryPartCFrame(CFrame.new(-323.838, -314.495, -4759.104))
- Crash1.Buttons.Button2.Indicator.BrickColor = BrickColor.new("Lime green")
- Crash1.Buttons.Button1.Indicator.BrickColor = BrickColor.new("Really red")
- Active = 2
- end
- elseif Active == 2 then
- Crash1.Wall:SetPrimaryPartCFrame(CFrame.new(-323.838, -314.495, -2711.104))
- Crash1.Buttons.Button1.Indicator.BrickColor = BrickColor.new("Lime green")
- Crash1.Buttons.Button2.Indicator.BrickColor = BrickColor.new("Really red")
- Active = 1
- end
- end)
- local RightCar = false
- function CheckVehicle(instance)
- if instance.Parent.Name == Plr.Name then
- RightCar = true
- elseif instance.Parent == workspace then
- RightCar = false
- else
- CheckVehicle(instance.Parent)
- end
- end
- Crash1.Wall.SpeedSensor.Touched:connect(function(part)
- CheckVehicle(part)
- if InUseCar and RightCar and (part.Name == "FL" or part.Name == "FR" or part.Name == "RL" or part.Name == "RR") and not CrashTestDebounce then
- CrashTestDebounce = true
- do
- local Distance = part.Velocity.Magnitude * 0.0375
- local Size = Crash1.Wall.Hitbox.Size
- local Pos = Crash1.Wall.Hitbox.CFrame
- local Touched
- if Distance < 15 then
- Crash1.Wall.Hitbox.Size = Vector3.new(30, 27, 2 + Distance)
- Crash1.Wall.Hitbox.CFrame = Pos + Vector3.new(0, 0, (2 + Distance) / 2)
- else
- Crash1.Wall.Hitbox.Size = Vector3.new(30, 27, 17)
- Crash1.Wall.Hitbox.CFrame = Pos + Vector3.new(0, 0, 8.5)
- end
- Touched = Crash1.Wall.Wall.Touched:connect(function()
- Touched:Disconnect()
- local r3 = R3(Crash1.Wall.Hitbox.Position, Crash1.Wall.Hitbox.Size)
- local Parts = game.Workspace:FindPartsInRegion3(r3, nil, math.huge)
- Crash1.DestroyParts:FireServer(Parts)
- Crash1.Wall.Hitbox.Size = Size
- Crash1.Wall.Hitbox.CFrame = Pos
- end)
- wait(5)
- Touched:Disconnect()
- Crash1.Wall.Hitbox.Size = Size
- Crash1.Wall.Hitbox.CFrame = Pos
- CrashTestDebounce = false
- end
- end
- end)
- Crash2.SpeedSensor.Touched:connect(function(part)
- CheckVehicle(part)
- if InUseCar and RightCar and (part.Name == "FL" or part.Name == "FR" or part.Name == "RL" or part.Name == "RR") and not CrashTestDebounce then
- CrashTestDebounce = true
- do
- local Distance = part.Velocity.Magnitude * 0.0375
- local Size = Crash2.Hitbox.Size
- local Pos = Crash2.Hitbox.CFrame
- local WaitStarted = false
- local Touched
- local Parts = {}
- if Distance < 15 then
- Crash2.Hitbox.Size = Vector3.new(30, 27, 2 * (1 + Distance))
- Crash2.Hitbox.CFrame = Pos
- else
- Crash2.Hitbox.Size = Vector3.new(30, 27, 32)
- Crash2.Hitbox.CFrame = Pos
- end
- Touched = Crash2.Hitbox.Touched:connect(function(part)
- table.insert(Parts, part)
- if not WaitStarted then
- WaitStarted = true
- wait(0.25)
- Touched:Disconnect()
- Crash2.DestroyParts:FireServer(Parts)
- Crash2.Hitbox.Size = Size
- Crash2.Hitbox.CFrame = Pos
- end
- end)
- wait(5)
- Touched:Disconnect()
- Crash2.Hitbox.Size = Size
- Crash2.Hitbox.CFrame = Pos
- Parts = nil
- CrashTestDebounce = false
- end
- end
- end)
- function ConnectTouch(Crusher)
- local Touch
- Touch = Crusher.Sensor.Touched:connect(function(part)
- if part.Parent then
- if part.Parent:FindFirstChild("Humanoid") or part.Parent.Parent:FindFirstChild("Humanoid") then
- if part.Name ~= "Marked" and part.Parent.Name == Plr.Name then
- Crusher.Destruction.DestroyPart:FireServer(part)
- end
- else
- CheckVehicle(part)
- if InUseCar and RightCar then
- Touch:Disconnect()
- do
- local Touched
- local Parts = {}
- for _, v in pairs(Crusher.Spikes:GetChildren()) do
- v.CanCollide = false
- end
- Touched = Crusher.Bottom.Touched:connect(function()
- Touched:Disconnect()
- for _, v in pairs(Crusher.Spikes:GetChildren()) do
- v.CanCollide = true
- table.insert(Parts, v:GetTouchingParts())
- end
- Crusher.Destruction.DestroyParts:FireServer(Parts)
- end)
- wait(5)
- Touched:Disconnect()
- for _, v in pairs(Crusher.Spikes:GetChildren()) do
- v.CanCollide = true
- end
- Parts = nil
- ConnectTouch(Crusher)
- end
- else
- Touch:Disconnect()
- wait(5)
- ConnectTouch(Crusher)
- end
- end
- end
- end)
- end
- ConnectTouch(workspace["All crushers"]["Spike Pit"])
- ConnectTouch(workspace["All crushers"]["Spikewall Cannon Shot"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement