Guest User

ClientDatabase (rbxlua)

a guest
Nov 25th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 112.04 KB | None | 0 0
  1. --StaySpy do not play with this code. (c)Missing Studios
  2.  
  3. local PhysicsFPSLimit = 70
  4. local SavingLimit = 3750
  5. local SaveWipe = 3
  6. local SaveSlots = 0
  7. local FreeSlots = 2
  8. local MaxSaveSlots = 6
  9. local PurchaseSlotID = 21612943
  10. local GamepassIDs = { 128667687; 128667735; 128667803; 128667851 }
  11. local BrickColors = {}
  12. local Global = {}
  13.  
  14. local PartLimits = {
  15.     MaximumThrustOutput = -10000;
  16.     MaximumHoverAltitude = 149;  
  17.     AltitudeStartingPoint = 27;  
  18.     GyroD = 500;
  19.     GyroP = 3000;
  20.     PositionD = 1250;
  21.     PositionP = 10000;
  22.     MaxSize = 130;
  23. }
  24.  
  25. local OverusedColors = {
  26.     red = Color3.new(255/255,85/255,127/255);
  27.     green = Color3.new(0/255,255/255,127/255);
  28. }
  29.  
  30. local plr = game.Players.LocalPlayer
  31. local mouse = plr:GetMouse()
  32. local SIService = game.ReplicatedStorage.ObtainCSIInstances:InvokeServer()
  33.  
  34. local run = game:GetService("RunService")
  35. local utility = LoadLibrary("RbxUtility")
  36. local http = game:GetService("HttpService")
  37. local market = game:GetService("MarketplaceService")
  38.  
  39. local sounds = plr.PlayerGui:WaitForChild("Sounds")
  40. local swipesfx = sounds:WaitForChild("SwipeSFX")
  41. local swipesfx2 = sounds:WaitForChild("SwipeSFX2")
  42. local clicksfx = sounds:WaitForChild("ClickSFX")
  43. local locksfx = sounds:WaitForChild("Lock")
  44. local hoversfx = sounds:WaitForChild("MouseHoverSFX")
  45. local notifysfx = sounds:WaitForChild("NotificationSound")
  46. local clicksfx2 = sounds:WaitForChild("ClickSFX2")
  47.  
  48. _G.GetCGPermissions = function()
  49.     local gadmin = SIService.GetPlayerFromGarage:InvokeServer(SIService.GetGarageFromPlayer:InvokeServer())
  50.     if gadmin then return SIService.GetPermissions:InvokeServer(gadmin,true) else return {enableforcefield = false; enablebuildingtools = false; blockplayer = false;} end
  51. end
  52.  
  53. _G.DivideUDim2 = function(dividend,divisor,divideoffsets)
  54.     return UDim2.new(
  55.         dividend.X.Scale/divisor.X.Scale,
  56.         divideoffsets and dividend.X.Offset/divisor.X.Offset or dividend.X.Offset,
  57.         dividend.Y.Scale/divisor.Y.Scale,
  58.         divideoffsets and dividend.Y.Offset/divisor.Y.Offset or dividend.Y.Offset
  59.     )
  60. end
  61.  
  62. _G.LaunchWindow = function(frame)
  63.     local DTXS = .2
  64.     local browser = plr.PlayerGui:findFirstChild("CyberBrowser",true)
  65.    
  66.     BrowserService = {}
  67.    
  68.     function BrowserService:UpdateTabs(tabs)
  69.         for _,w in pairs(tabs:GetChildren()) do w:TweenSizeAndPosition(UDim2.new(#tabs:GetChildren() > 1/DTXS and 1/#tabs:GetChildren() or DTXS,0,1,-1),UDim2.new(#tabs:GetChildren() > 1/DTXS and 1/#tabs:GetChildren() * _ - 1/#tabs:GetChildren() or DTXS * _ - DTXS,0,0,0),"Out","Quad",.3,true,nil) end
  70.     end
  71.    
  72.     if not browser then
  73.         browser = game.ReplicatedStorage.Miscellaneous.CyberBrowser:Clone()
  74.         local Bsize = browser.Size
  75.         local Bpos = browser.Position
  76.         browser.Size = UDim2.new(Bsize.X.Scale,0,0,0)
  77.         browser.Position = UDim2.new(Bsize.X.Scale/2,0,Bsize.Y.Scale/2,0)
  78.         local top = browser.TopSection
  79.         local screen = browser.Screen
  80.         local window = browser.Screen.Window
  81.         local tabs = browser.Tabs
  82.         local ssize = screen.Size
  83.         local spos = screen.Position
  84.         local tsize = tabs.Size
  85.         local tpos = tabs.Position
  86.         local ttsize = top.Size
  87.         local ttpos = top.Position
  88.        
  89.         browser.DescendantAdded:connect(function(des)
  90.             if des:IsA("GuiButton") then
  91.                 des.MouseButton1Click:connect(function()
  92.                     clicksfx2:Play()
  93.                 end)
  94.             end
  95.         end)
  96.        
  97.         top.ExitTab.MouseButton1Click:connect(function()
  98.             local direction = window:GetChildren()[1].Name
  99.             local tabpositions = tabs:GetChildren()
  100.             local directorypos
  101.             for _,w in pairs(tabpositions) do if w.Name == direction then directorypos = _ break end end
  102.             local nextindex,newtab = next(tabpositions,directorypos)
  103.             window[direction]:remove()
  104.             tabs[direction]:remove()
  105.             BrowserService:UpdateTabs(tabs)
  106.             local replacement = newtab or tabs:GetChildren()[1]
  107.             if replacement then
  108.                 replacement.Style = "RobloxRoundDropdownButton"
  109.                 script[replacement.Name].Parent = window
  110.                 top.Text = "BYC - "..replacement.Text
  111.             else
  112.                 top.Text = "Cyber Browser"
  113.                 script:ClearAllChildren()
  114.                 tabs:ClearAllChildren()
  115.                 window:ClearAllChildren()
  116.                 browser:TweenSizeAndPosition(
  117.                     UDim2.new(
  118.                         browser.Size.X.Scale,0,0,0
  119.                     ),
  120.                     UDim2.new(
  121.                         browser.Position.X.Scale  + browser.Size.X.Scale/2,
  122.                         browser.Position.X.Offset + browser.Size.X.Offset,
  123.                         browser.Position.Y.Scale  + browser.Size.Y.Scale/2,
  124.                         browser.Position.Y.Offset + browser.Size.X.Offset/2
  125.                     ),
  126.                     "Out","Linear",.2,true,
  127.                     function()
  128.                         browser:Destroy()
  129.                     end
  130.                 )
  131.             end
  132.         end)
  133.        
  134.         top.Exit.MouseButton1Click:connect(function()
  135.             script:ClearAllChildren()
  136.             tabs:ClearAllChildren()
  137.             local page = window:GetChildren()[1]
  138.             page:TweenSizeAndPosition(UDim2.new(page.Size.X.Scale,0,0,0),UDim2.new(0,0,.5,0),"Out","Quad",.1,true,function()
  139.                 window:ClearAllChildren()
  140.                 browser:TweenSizeAndPosition(
  141.                     UDim2.new(
  142.                         browser.Size.X.Scale,0,0,0
  143.                     ),
  144.                     UDim2.new(
  145.                         browser.Position.X.Scale  + browser.Size.X.Scale/2,
  146.                         browser.Position.X.Offset + browser.Size.X.Offset,
  147.                         browser.Position.Y.Scale  + browser.Size.Y.Scale/2,
  148.                         browser.Position.Y.Offset + browser.Size.X.Offset/2
  149.                     ),
  150.                     "Out","Linear",.2,true,
  151.                     function()
  152.                         browser:Destroy()
  153.                     end
  154.                 )
  155.             end)
  156.         end)
  157.        
  158.         top.MouseEnter:connect(function()
  159.             browser.Active = true
  160.             browser.Draggable = true
  161.         end)
  162.        
  163.         top.MouseLeave:connect(function()
  164.             browser.Active = false
  165.             browser.Draggable = false
  166.         end)
  167.        
  168.         local listener
  169.        
  170.         local db = false
  171.         local function UpdateBrowserSize()
  172.             if db then return end
  173.             db = true
  174.             browser.Size = UDim2.new(
  175.                 (mouse.X + 9 - browser.AbsolutePosition.X)/mouse.ViewSizeX,0,
  176.                 (mouse.Y + 9 - browser.AbsolutePosition.Y)/mouse.ViewSizeY,0
  177.             )
  178.             db = false
  179.         end
  180.        
  181.         browser.Resize.MouseButton1Down:connect(function()
  182.             if listener then return end
  183.             listener = mouse.Move:connect(UpdateBrowserSize)
  184.             local disconnection
  185.             local otherdisconnection
  186.             disconnection = mouse.Button1Up:connect(function()
  187.                 disconnection:disconnect()
  188.                 otherdisconnection:disconnect()
  189.                 listener:disconnect()
  190.                 listener = nil
  191.             end)
  192.             otherdisconnection = browser.Resize.MouseButton1Up:connect(function()
  193.                 disconnection:disconnect()
  194.                 otherdisconnection:disconnect()
  195.                 listener:disconnect()
  196.                 listener = nil
  197.             end)
  198.         end)
  199.        
  200.         browser.Resize.MouseButton2Down:connect(function()
  201.             if listener then listener:disconnect() end
  202.            
  203.             browser.Size = Bsize
  204.             browser.Position = Bpos
  205.         end)
  206.        
  207.         tabs.ChildAdded:connect(function(child)
  208.             child.MouseButton1Click:connect(function()
  209.                 if window:GetChildren()[1].Name == child.Name then return end
  210.                 for _,w in pairs(tabs:GetChildren()) do if w ~= child then w.Style = "RobloxRoundDefaultButton" end end
  211.                 child.Style = "RobloxRoundDropdownButton"
  212.                 window:GetChildren()[1].Parent = script
  213.                 script[child.Text].Parent = window
  214.                 top.Text = "BYC - "..child.Text
  215.             end)
  216.         end)
  217.        
  218.         local tab = game.ReplicatedStorage.Miscellaneous.TabTemplate:Clone()
  219.         tab.Style = "RobloxRoundDropdownButton"
  220.         tab.Text = frame.Name
  221.         tab.Name = frame.Name
  222.         tab.Position = UDim2.new(0,0,0,0)
  223.         tab.Size = UDim2.new(0,0,1,-1)
  224.         tab.Parent = tabs
  225.         top.Text = "BYC - "..tab.Text
  226.         frame.Parent = window
  227.         browser.Parent = plr.PlayerGui.Interface
  228.         BrowserService:UpdateTabs(tabs)
  229.         browser:TweenSizeAndPosition(Bsize,Bpos,"Out","Linear",.2,true)
  230.     else
  231.         local top = browser.TopSection
  232.         local window = browser.Screen.Window
  233.         local tabs = browser.Tabs
  234.         local tab = game.ReplicatedStorage.Miscellaneous.TabTemplate:Clone()
  235.         tab.Style = "RobloxRoundDropdownButton"
  236.         tab.Text = frame.Name
  237.         tab.Name = frame.Name
  238.         tab.Position = UDim2.new(DTXS * tabs:GetChildren())
  239.         tab.Size = UDim2.new(0,0,1,-1)
  240.         tab.Parent = tabs
  241.         top.Text = "BYC - "..tab.Text
  242.         local fsize = frame.Size
  243.         local fpos = frame.Pos
  244.         frame.Size = UDim2.new(fsize.X.Scale,0,0,0)
  245.         frame.Position = UDim2.new(fpos.X.Scale/2,0,.5,0)
  246.         BrowserService:UpdateTabs(tabs)
  247.         frame.Parent = window
  248.         frame:TweenSizeAndPosition(fsize,fpos,"Out","Quad",.1,true)
  249.     end
  250.     return frame
  251. end
  252.  
  253. _G.rotateModel = function(model,center,rotation)
  254.     local parts = {}
  255.     local function scan(parent)
  256.         for _,obj in pairs(parent:GetChildren()) do
  257.             if (obj:IsA("BasePart")) then
  258.                 table.insert(parts,obj)
  259.             end
  260.             scan(obj)
  261.         end
  262.     end
  263.     scan(model)
  264.     for _,part in pairs(parts) do
  265.         part.CFrame = (center*rotation*(center:inverse()*part.CFrame))
  266.     end
  267. end
  268. _G.Iterate = function(func,start)
  269.     for _,w in pairs(start:GetChildren()) do
  270.         func(w)
  271.         _G.Iterate(func,w)
  272.     end
  273. end
  274. _G.run = game:GetService("RunService")
  275. _G.Team = plr.PlayerGui:WaitForChild("Team")
  276. _G.translation = {
  277.     ["Player Eight"] = 8,
  278.     ["Player Seven"] = 7,
  279.     ["Player Six"] = 6,
  280.     ["Player Five"] = 5,
  281.     ["Player Four"] = 4,
  282.     ["Player Three"] = 3,
  283.     ["Player Two"] = 2,
  284.     ["Player One"] = 1,
  285. }
  286.  
  287. for _,w in pairs(game.Teams:GetChildren()) do
  288.     if w.TeamColor == plr.TeamColor then plr.PlayerGui.Team.Value = _G.translation[w.Name] end
  289. end
  290.  
  291. function findParts(match)
  292.     local parts = {}
  293.     for _,w in pairs(workspace:GetChildren()) do
  294.         if string.match(string.sub(w.Name,1,string.len(match)),match) and w:IsA("BasePart") then table.insert(parts,w) end
  295.     end
  296.     return parts
  297. end
  298.  
  299. function removeparts(tableofparts)
  300.     for _,w in pairs(tableofparts) do
  301.         w:remove()
  302.     end
  303. end
  304.  
  305. function rot(gui,start,finish)
  306.     local diff = finish - start
  307.     for i = 0,1,.1 do
  308.         gui.Rotation = start + (diff*i)
  309.         wait()
  310.     end
  311.     gui.Rotation = finish
  312. end
  313.  
  314. function UnequipStuff(dontincludeFF)
  315.     if plr.Character and plr.Character:findFirstChild("Humanoid") then plr.Character.Humanoid:UnequipTools() if plr.Character:findFirstChild("ForceField") and not dontincludeFF then plr.Character.ForceField:remove() end end
  316.     game.StarterGui:SetCoreGuiEnabled("Backpack",false)
  317. end
  318.  
  319. function ConvertColor3(color3)
  320.     return Color3.new(color3.r/255,color3.g/255,color3.b/255)
  321. end
  322.  
  323. function getlength(tab)
  324.     local count = 0
  325.     for _,w in pairs(tab) do count = count + 1 end
  326.     return count
  327. end
  328.  
  329. function createC2Scale(left,right,minimum,maximum,increment,start)
  330.     local signal = utility.CreateSignal()
  331.     local num = start
  332.     left.MouseButton1Click:connect(function()
  333.         if num - increment < minimum then num = minimum signal:fire(num) else num = num - increment signal:fire(num) end
  334.     end)
  335.     right.MouseButton1Click:connect(function()
  336.         if num + increment > maximum then num = maximum signal:fire(num) else num = num + increment signal:fire(num) end
  337.     end)
  338.     return signal
  339. end
  340.  
  341. function createDropUp(click,template,box,options)
  342.     local signal = utility.CreateSignal()
  343.     clicked = false
  344.     for _,w in pairs(options) do
  345.         local opt = template:Clone()
  346.         opt.Size = UDim2.new(1,0,1/getlength(options),0)
  347.         opt.Position = UDim2.new(0,0,#box:GetChildren()/getlength(options),0)
  348.         opt.Text = type(w) == "userdata" and w.Name or w
  349.         opt.Parent = box
  350.         opt.Visible = true
  351.         opt.MouseEnter:connect(function()
  352.             opt.BackgroundTransparency = .9
  353.         end)
  354.         opt.MouseLeave:connect(function()
  355.             opt.BackgroundTransparency =  1
  356.         end)
  357.        
  358.         opt.MouseButton1Click:connect(function()
  359.             clicked = false
  360.             box.Size = UDim2.new(1,0,0,0)
  361.             signal:fire(opt.Text)
  362.         end)
  363.     end
  364.    
  365.     click.MouseButton1Click:connect(function()
  366.         if not clicked then
  367.             clicked = true
  368.             box.Size = UDim2.new(1,0,-getlength(options),0)
  369.         else
  370.             clicked = false
  371.             box.Size = UDim2.new(1,0,0,0)
  372.         end
  373.     end)
  374.    
  375.     return signal
  376. end
  377.  
  378. SIService.BlockPlayer.OnClientEvent:connect(function(garage,bool)
  379.     local blockparts = game.ReplicatedStorage.LocalBlockParts
  380.     if bool then
  381.         local block = blockparts["Collider"..garage]:Clone()
  382.         block.Parent = workspace.CurrentCamera
  383.         block.CFrame = blockparts["Collider"..garage].CFrame
  384.         block.CanCollide = true
  385.     else
  386.         local block = workspace.CurrentCamera:findFirstChild("Collider"..garage)
  387.         if block then block:remove() end
  388.     end
  389. end)
  390.  
  391. game.ReplicatedStorage.GarageDetection["Garage".._G.Team.Value].ChildRemoved:connect(function(child)
  392.     if child.Value == plr then UnequipStuff() end
  393. end)
  394.  
  395. SIService.SafteyPlayer.OnClientEvent:connect(UnequipStuff)
  396. SIService.SetCoreGuiEnabled.OnClientEvent:connect(function(coreguitype,bool)
  397.     game.StarterGui:SetCoreGuiEnabled(coreguitype,bool or not game.StarterGui:GetCoreGuiEnabled(coreguitype))
  398. end)
  399.  
  400. local interface = game.ReplicatedStorage.Interface:Clone()
  401. local InterfaceFunctions = {
  402.     Sidebar = function(interface)
  403.         local opt = interface.Options
  404.        
  405.         local expanded = {
  406.             ForceField = true;
  407.             WalkSpeed = false;
  408.             Clean = false;
  409.             ["Stuff Lock"] = false;
  410.         }
  411.        
  412.         local IsOut = false
  413.         local IsOutCP = false
  414.        
  415.         opt.Position = UDim2.new(1,0,0,0)
  416.         local guiinfo = {
  417.             ForceField = {
  418.                 g = opt.ForceField,
  419.                 gpos = opt.ForceField.Position,
  420.                 size = opt.ForceField.Size,
  421.                 ts = opt.ForceField.TextLabel.Size,
  422.                 t = opt.ForceField.TextLabel,
  423.                 expand = UDim2.new(1,0,.075,0);
  424.                 exfunc = function(section)
  425.                     local label = section.TextLabel
  426.                     if SIService.IsInGarage:InvokeServer(_G.Team.Value) or _G.GetCGPermissions().enableforcefield then
  427.                         if plr.Character then
  428.                             local force = plr.Character:findFirstChild("ForceField")
  429.                             if force then force:remove() else Instance.new("ForceField",plr.Character) end
  430.                         else
  431.                             label.Text = "Nonexistant Character"
  432.                             wait(1)
  433.                             label.Text = "ForceField"
  434.                         end
  435.                     else
  436.                         label.Text = "No ForceField Area"
  437.                         wait(1)
  438.                         label.Text = "ForceField"
  439.                     end
  440.                 end
  441.             };
  442.             WalkSpeed = {
  443.                 g = opt.WalkSpeed,
  444.                 gpos = opt.WalkSpeed.Position,
  445.                 size = opt.WalkSpeed.Size,
  446.                 ts = opt.WalkSpeed.TextLabel.Size,
  447.                 t = opt.WalkSpeed.TextLabel,
  448.                 expand = UDim2.new(1,0,.225,0);
  449.                 exfunc = function(section)
  450.                     wait(.15)
  451.                     local gui = game.ReplicatedStorage.OptionsBox.WalkSpeed:Clone()
  452.                     local run = gui.Run
  453.                     local walk = gui.Walk
  454.                     local err = gui.ErrorMessage
  455.                    
  456.                     function GenError(message)
  457.                         run.Active = false
  458.                         run.Visible = false
  459.                         walk.Active = false
  460.                         walk.Visible = false
  461.                         err.Text = message
  462.                         err.Visible = true
  463.                         wait(1)
  464.                         err.Text = ""
  465.                         err.Visible = false
  466.                         run.Active = true
  467.                         run.Visible = true
  468.                         walk.Active = true
  469.                         walk.Visible = true
  470.                     end
  471.                    
  472.                     if plr.Character and plr.Character:findFirstChild("Humanoid") then
  473.                         if plr.Character.Humanoid.WalkSpeed == 30 then
  474.                             walk.Position = UDim2.new(0,0,0,0)
  475.                             run.Position = UDim2.new(1,0,0,0)
  476.                         else
  477.                             walk.Position = UDim2.new(1,0,0,0)
  478.                             run.Position = UDim2.new(0,0,0,0)
  479.                         end
  480.                     end
  481.                     run.MouseButton1Click:connect(function()
  482.                         if not plr.Character then GenError("Nonexistant Character") return end
  483.                         if plr.Character.Humanoid.Health == 0 then GenError("Dead Robloxian") return end
  484.                         run.Active = false
  485.                         walk.Active = false
  486.                         walk.Position = UDim2.new(1,0,0,0)
  487.                         swipesfx2:Play()
  488.                         run:TweenPosition(UDim2.new(-1,0,0,0),"Out","Linear",.1,true,nil)
  489.                         walk:TweenPosition(UDim2.new(0,0,0,0),"Out","Linear",.1,true,nil)
  490.                         plr.Character.Humanoid.WalkSpeed = 30
  491.                         wait(.1)
  492.                         run.Active = true
  493.                         walk.Active = true
  494.                     end)
  495.                     walk.MouseButton1Click:connect(function()
  496.                         if not plr.Character then GenError("Nonexistant Character") return end
  497.                         if plr.Character.Humanoid.Health == 0 then GenError("Dead Robloxian") return end
  498.                         run.Active = false
  499.                         walk.Active = false
  500.                         run.Position = UDim2.new(1,0,0,0)
  501.                         swipesfx2:Play()
  502.                         run:TweenPosition(UDim2.new(0,0,0,0),"Out","Linear",.1,true,nil)
  503.                         walk:TweenPosition(UDim2.new(-1,0,0,0),"Out","Linear",.1,true,nil)
  504.                         plr.Character.Humanoid.WalkSpeed = 16
  505.                         wait(.1)
  506.                         run.Active = true
  507.                         walk.Active = true
  508.                     end)
  509.                    
  510.                     gui.Position = UDim2.new(1,0,.4,0)
  511.                     gui.Parent = section
  512.                     gui:TweenPosition(UDim2.new(.05,0,.4,0),"Out","Quad",.15,true,nil)
  513.                     repeat wait() until not expanded.WalkSpeed
  514.                     gui:TweenPosition(UDim2.new(1,0,.4,0),"Out","Quad",.15,false,nil)
  515.                     wait(.15)
  516.                     gui:remove()
  517.                 end
  518.             };
  519.             Clean = {
  520.                 g = opt.Clean,
  521.                 gpos = opt.Clean.Position,
  522.                 size = opt.Clean.Size,
  523.                 ts = opt.Clean.TextLabel.Size,
  524.                 t = opt.Clean.TextLabel,
  525.                 expand = UDim2.new(1,0,.35,0);
  526.                 exfunc = function(section)
  527.                     local gui = game.ReplicatedStorage.OptionsBox.Clean:Clone()
  528.                     for _,w in pairs(gui.Other:GetChildren()) do w.MouseButton1Click:connect(function() removeparts(SIService.FindParts:InvokeServer(_G.Team.Value,nil,w.Name)) end) end
  529.                    
  530.                     gui["Clean All Parts"].MouseButton1Click:connect(function() removeparts(SIService.FindParts:InvokeServer(_G.Team.Value)) end)
  531.                     gui["Clean Unowned Parts"].MouseButton1Click:connect(function() for i = 1,8 do spawn(function() if i == _G.Team.Value then return end removeparts(SIService.FindParts:InvokeServer(i,_G.Team.Value)) end) end end)
  532.                    
  533.                     for _,w in pairs(gui:GetChildren()) do w.Position = w.Position + UDim2.new(1,0,0,0) end
  534.                     gui.Parent = section
  535.                     for _,w in pairs(gui:GetChildren()) do w:TweenPosition(w.Position - UDim2.new(1,0,0,0),"Out","Quad",.3,true) wait(.15) end
  536.                     repeat wait() until not expanded.Clean
  537.                     gui:remove()
  538.                 end
  539.             };
  540.             ["Stuff Lock"] = {
  541.                 g = opt["Stuff Lock"],
  542.                 gpos = opt["Stuff Lock"].Position,
  543.                 size = opt["Stuff Lock"].Size,
  544.                 ts = opt["Stuff Lock"].TextLabel.Size,
  545.                 t = opt["Stuff Lock"].TextLabel,
  546.                 expand = UDim2.new(1,0,.225,0);
  547.                 exfunc = function(section)
  548.                     wait(.15)
  549.                     local lock = game.ReplicatedStorage.OptionsBox.StuffLock:Clone()
  550.                     lock.Position = UDim2.new(.25,0,1,0)
  551.                     lock.Parent = section
  552.                     lock:TweenPosition(UDim2.new(.25,0,.275,0),"Out","Quad",.5,true,nil)
  553.                     lock.MouseButton1Click:connect(function()
  554.                         lock.Active = false
  555.                         if lock.Image == "rbxassetid://179760592" then
  556.                             --locking
  557.                             for _,w in pairs(findParts(_G.Team.Value)) do
  558.                                 w.Locked = true
  559.                             end
  560.                             lock.Image = "rbxassetid://179760594"
  561.                         else
  562.                             --unlocking
  563.                             for _,w in pairs(findParts(_G.Team.Value)) do
  564.                                 w.Locked = false
  565.                             end
  566.                             lock.Image = "rbxassetid://179760592"
  567.                         end
  568.                         locksfx:Play()
  569.                         lock.Active = true
  570.                     end)
  571.                     repeat wait() until not expanded["Stuff Lock"]
  572.                     lock:TweenPosition(UDim2.new(.25,0,-.75,0),"Out","Quad",.15,true,nil)
  573.                 end
  574.             };
  575.         }
  576.        
  577.         for _,w in pairs(guiinfo) do
  578.             w.g.Changed:connect(function(prop)
  579.                 if prop == "Size" then
  580.                     local last
  581.                     local newtab = {
  582.                         guiinfo.ForceField,
  583.                         guiinfo.WalkSpeed,
  584.                         guiinfo.Clean,
  585.                         guiinfo["Stuff Lock"],
  586.                     }
  587.                     for i,v in pairs(newtab) do
  588.                         local pos = v.g.Position
  589.                         v.g.Position = UDim2.new(pos.X.Scale,0, last and (last.g.Position.Y.Scale + last.g.Size.Y.Scale) or .1,0)
  590.                         last = v
  591.                     end
  592.                     w.t.Size = UDim2.new(1,0,w.size.Y.Scale/w.g.Size.Y.Scale,0)
  593.                 end
  594.             end)
  595.             w.t.MouseEnter:connect(function()
  596.                 if w.expanded then return end
  597.                 swipesfx:Play()
  598.                 w.t.Font = "Arial"
  599.             end)
  600.            
  601.             w.t.MouseLeave:connect(function()
  602.                 if w.expanded then return end
  603.                 w.t.Font = "SourceSans"
  604.             end)
  605.            
  606.             w.g.MouseButton1Click:connect(function()
  607.                 if not expanded[w.g.Name] or w.g.Name == "ForceField" then
  608.                     if w.exfunc then
  609.                         w.Active = false
  610.                         w.t.Font = "SourceSans"
  611.                         expanded[w.g.Name] = true
  612.                         clicksfx:Play()
  613.                         w.g:TweenSize(w.expand,"Out","Quad",.15,true,nil)
  614.                         w.exfunc(w.g)
  615.                         w.Active = true
  616.                     end
  617.                 else
  618.                     if w.exfunc then
  619.                         w.Active = false
  620.                         w.t.Font = "SourceSans"
  621.                         expanded[w.g.Name] = false
  622.                         clicksfx:Play()
  623.                         w.g:TweenSize(w.size,"Out","Quad",.15,true,nil)
  624.                         w.Active = true
  625.                     end
  626.                 end
  627.             end)
  628.         end
  629.        
  630.         for _,w in pairs(guiinfo) do
  631.             w.g.Position = w.g.Position + UDim2.new(1,0,0,0)
  632.         end
  633.        
  634.         local function openOptions()
  635.             IsOut = true
  636.             opt:TweenPosition(UDim2.new(0,0,0,0),"Out","Linear",.3,true,nil)
  637.             wait(.3)
  638.             local last
  639.             local newtab = {
  640.                 guiinfo.ForceField,
  641.                 guiinfo.WalkSpeed,
  642.                 guiinfo.Clean,
  643.                 guiinfo["Stuff Lock"],
  644.             }
  645.             for i,v in pairs(newtab) do
  646.                 local pos = v.g.Position
  647.                 v.g.Position = UDim2.new(pos.X.Scale,0, last and (last.g.Position.Y.Scale + last.g.Size.Y.Scale) or .1,0)
  648.                 last = v
  649.             end
  650.             for _,w in pairs(guiinfo) do
  651.                 w.g:TweenPosition(w.g.Position - UDim2.new(1,0,0,0),"Out","Quad",.3,true,nil)
  652.                 wait(.15)
  653.             end
  654.         end
  655.        
  656.         local function closeOptions()
  657.             IsOut = false
  658.             for _,w in pairs(guiinfo) do
  659.                 w.g:TweenPosition(w.gpos + UDim2.new(1,0,0,0),"Out","Quad",.15,true,nil)
  660.                 wait(.075)
  661.             end
  662.             wait(.15)
  663.             opt:TweenPosition(UDim2.new(1,0,0,0),"Out","Linear",.15,true,nil)
  664.         end
  665.        
  666.         local function returnScalarPoint(slider)
  667.             local pointChanged = utility.CreateSignal()
  668.             slider.Draggable = false
  669.            
  670.             local listenToMouseMovement
  671.             local disconnectMovement
  672.             local disconnectMovementReinforce
  673.             local disconnectMovementReinforce2
  674.            
  675.             slider.MouseButton1Down:connect(function()
  676.                 listenToMouseMovement = mouse.Move:connect(function()
  677.                     if not slider or slider.Parent == nil then return end
  678.                     local scale = (mouse.X - slider.Parent.AbsolutePosition.x - slider.AbsoluteSize.x)/(slider.Parent.AbsoluteSize.x - slider.AbsoluteSize.x)
  679.                     if scale < 0 then scale = 0 elseif scale > (1 - slider.Size.X.Scale) then scale = 1 - slider.Size.X.Scale end
  680.                     slider.Position = UDim2.new(scale,0,-.85,0)
  681.                     pointChanged:fire(slider.Position.X.Scale / ( 1 - slider.Size.X.Scale ))
  682.                 end)
  683.                
  684.                 disconnectMovement = slider.MouseButton1Up:connect(function()
  685.                     listenToMouseMovement:disconnect()
  686.                     disconnectMovement:disconnect()
  687.                     disconnectMovementReinforce:disconnect()
  688.                     disconnectMovementReinforce2:disconnect()
  689.                 end)
  690.                
  691.                 disconnectMovementReinforce = mouse.Button1Up:connect(function()
  692.                     listenToMouseMovement:disconnect()
  693.                     disconnectMovement:disconnect()
  694.                     disconnectMovementReinforce:disconnect()
  695.                     disconnectMovementReinforce2:disconnect()
  696.                 end)
  697.                
  698.                 disconnectMovementReinforce2 = slider.Parent.Parent.MouseLeave:connect(function()
  699.                     listenToMouseMovement:disconnect()
  700.                     disconnectMovement:disconnect()
  701.                     disconnectMovementReinforce:disconnect()
  702.                     disconnectMovementReinforce2:disconnect()
  703.                 end)
  704.             end)
  705.             return pointChanged
  706.         end
  707.        
  708.         local pcpConnections = {}
  709.         local pcpSignals = {
  710.             Hovers = utility.CreateSignal();
  711.             Thrusters = utility.CreateSignal();
  712.             Lights = utility.CreateSignal();
  713.             Seats = utility.CreateSignal();
  714.             Followers = utility.CreateSignal();
  715.             Stablizers = utility.CreateSignal();
  716.         }
  717.         local pcpSettings = {
  718.             Hovers = {
  719.                 controlBy = "All";
  720.                 obj = setmetatable({},{
  721.                     __newindex = function(obj,i,v)
  722.                         rawset(obj,i,v)
  723.                         pcpSignals.Hovers:fire(v)
  724.                         v.Changed:connect(function()
  725.                             if not v or v.Parent == nil then
  726.                                 obj[i] = nil
  727.                                 pcpSignals.Hovers:fire()
  728.                             end
  729.                         end)
  730.                     end
  731.                 });
  732.                 giveFunctionality = function(self,gui,cpart)
  733.                     if cpart == "All" then
  734.                         gui.Enabled.MouseButton1Click:connect(function()
  735.                             if gui.Enabled.Text == "Off" then
  736.                                 gui.Enabled.Text = "On"
  737.                                 gui.Enabled.BackgroundColor3 = OverusedColors.green
  738.                                 for _,w in pairs(self.obj) do
  739.                                     w.BodyPosition.P = PartLimits.PositionP
  740.                                     w.BodyPosition.D = PartLimits.PositionD
  741.                                 end
  742.                             else
  743.                                 gui.Enabled.Text = "Off"
  744.                                 gui.Enabled.BackgroundColor3 = OverusedColors.red
  745.                                 for _,w in pairs(self.obj) do
  746.                                     w.BodyPosition.P = 0
  747.                                     w.BodyPosition.D = 0
  748.                                 end
  749.                             end
  750.                         end)
  751.                         returnScalarPoint(gui.Altitude.Slider):connect(function(scale)
  752.                             for _,w in pairs(self.obj) do
  753.                                 w.BodyPosition.position = Vector3.new(w.Position.x,PartLimits.AltitudeStartingPoint + PartLimits.MaximumHoverAltitude*scale,w.Position.z)
  754.                             end
  755.                         end)
  756.                     else
  757.                         gui.Enabled.MouseButton1Click:connect(function()
  758.                             if gui.Enabled.Text == "Off" then
  759.                                 gui.Enabled.Text = "On"
  760.                                 gui.Enabled.BackgroundColor3 = OverusedColors.green
  761.                                 cpart.BodyPosition.P = PartLimits.PositionP
  762.                                 cpart.BodyPosition.D = PartLimits.PositionD
  763.                             else
  764.                                 gui.Enabled.Text = "Off"
  765.                                 gui.Enabled.BackgroundColor3 = OverusedColors.red
  766.                                 cpart.BodyPosition.P = 0
  767.                                 cpart.BodyPosition.D = 0
  768.                             end
  769.                         end)
  770.                         returnScalarPoint(gui.Altitude.Slider):connect(function(scale)
  771.                             if not cpart or not cpart.Parent then return end
  772.                             cpart.BodyPosition.position = Vector3.new(cpart.Position.x,PartLimits.AltitudeStartingPoint + PartLimits.MaximumHoverAltitude*scale,cpart.Position.z)
  773.                         end)
  774.                         if cpart.BodyPosition.P ~= 0 and cpart.BodyPosition.D ~= 0 then
  775.                             gui.Enabled.Text = "On"
  776.                             gui.Enabled.BackgroundColor3 = OverusedColors.green
  777.                         end
  778.                         if cpart.BodyPosition.position.Y > PartLimits.AltitudeStartingPoint then
  779.                             gui.Altitude.Slider.Position = UDim2.new((cpart.BodyPosition.position.Y - PartLimits.AltitudeStartingPoint)/(PartLimits.MaximumHoverAltitude - PartLimits.AltitudeStartingPoint) - gui.Altitude.Slider.Position.X.Scale,0,-.85,0)
  780.                         end
  781.                     end
  782.                 end
  783.             };
  784.             Thrusters = {
  785.                 controlBy = "All";
  786.                 obj = setmetatable({},{
  787.                     __newindex = function(obj,i,v)
  788.                         rawset(obj,i,v)
  789.                         pcpSignals.Thrusters:fire(v)
  790.                         v.Changed:connect(function()
  791.                             if not v or v.Parent == nil then
  792.                                 obj[i] = nil
  793.                                 pcpSignals.Thrusters:fire()
  794.                             end
  795.                         end)
  796.                     end
  797.                 });
  798.                 giveFunctionality = function(self,gui,cpart)
  799.                     if cpart == "All" then
  800.                         returnScalarPoint(gui["Thrust Output"].Slider):connect(function(scale)
  801.                             for _,w in pairs(self.obj) do
  802.                                 w.BodyThrust.force = Vector3.new(PartLimits.MaximumThrustOutput*scale,0,0)
  803.                                 if scale > 0 then w.Fire.Enabled = true w.Fire.Size = scale * 20 else w.Fire.Enabled = false end
  804.                             end
  805.                         end)
  806.                     elseif cpart == "X" then
  807.                         returnScalarPoint(gui["Thrust Output"].Slider):connect(function(scale)
  808.                             for _,w in pairs(self.obj) do
  809.                                 if string.sub(w.Name,2,2) == "X" then
  810.                                     w.BodyThrust.force = Vector3.new(PartLimits.MaximumThrustOutput*scale,0,0)
  811.                                     if scale > 0 then w.Fire.Enabled = true w.Fire.Size = scale * 20 else w.Fire.Enabled = false end
  812.                                 end
  813.                             end
  814.                         end)
  815.                     elseif cpart == "Y" then
  816.                         returnScalarPoint(gui["Thrust Output"].Slider):connect(function(scale)
  817.                             for _,w in pairs(self.obj) do
  818.                                 if string.sub(w.Name,2,2) == "Y" then
  819.                                     w.BodyThrust.force = Vector3.new(PartLimits.MaximumThrustOutput*scale,0,0)
  820.                                     if scale > 0 then w.Fire.Enabled = true w.Fire.Size = scale * 20 else w.Fire.Enabled = false end
  821.                                 end
  822.                             end
  823.                         end)
  824.                     elseif cpart == "Z" then
  825.                         returnScalarPoint(gui["Thrust Output"].Slider):connect(function(scale)
  826.                             for _,w in pairs(self.obj) do
  827.                                 if string.sub(w.Name,2,2) == "Z" then
  828.                                     w.BodyThrust.force = Vector3.new(PartLimits.MaximumThrustOutput*scale,0,0)
  829.                                     if scale > 0 then w.Fire.Enabled = true w.Fire.Size = scale * 20 else w.Fire.Enabled = false end
  830.                                 end
  831.                             end
  832.                         end)
  833.                     else
  834.                         returnScalarPoint(gui["Thrust Output"].Slider):connect(function(scale)
  835.                             if not cpart or not cpart.Parent then return end
  836.                             cpart.BodyThrust.force = Vector3.new(PartLimits.MaximumThrustOutput*scale,0,0)
  837.                             if scale > 0 then cpart.Fire.Enabled = true cpart.Fire.Size = scale * 20 else cpart.Fire.Enabled = false end
  838.                         end)
  839.                         if cpart.BodyThrust.force.X < 0 then
  840.                             gui["Thrust Output"].Slider.Position = UDim2.new(cpart.BodyThrust.force.X / PartLimits.MaximumThrustOutput - gui["Thrust Output"].Slider.Size.X.Scale,0,-.85,0)
  841.                         end
  842.                     end
  843.                 end
  844.             };
  845.             Lights = {
  846.                 controlBy = "All";
  847.                 obj = setmetatable({},{
  848.                     __newindex = function(obj,i,v)
  849.                         rawset(obj,i,v)
  850.                         pcpSignals.Lights:fire(v)
  851.                         v.Changed:connect(function()
  852.                             if not v or v.Parent == nil then
  853.                                 obj[i] = nil
  854.                                 pcpSignals.Lights:fire()
  855.                             end
  856.                         end)
  857.                     end
  858.                 });
  859.                 giveFunctionality = function(self,gui,cpart)
  860.                     if cpart == "All" then
  861.                         gui.Enabled.MouseButton1Click:connect(function()
  862.                             for _,w in pairs(self.obj) do
  863.                                 w.PointLight.Enabled = not gui.Enabled.GradientBlocks.Visible
  864.                             end
  865.                             gui.Enabled.GradientBlocks.Visible = not gui.Enabled.GradientBlocks.Visible
  866.                         end)
  867.                     else
  868.                         gui.Enabled.MouseButton1Click:connect(function()
  869.                             cpart.PointLight.Enabled = not gui.Enabled.GradientBlocks.Visible
  870.                             gui.Enabled.GradientBlocks.Visible = not gui.Enabled.GradientBlocks.Visible
  871.                         end)
  872.                         if not cpart.PointLight.Enabled then
  873.                             gui.Enabled.GradientBlocks.Visible = false
  874.                         end
  875.                     end
  876.                 end
  877.             };
  878.             Seats = {
  879.                 controlBy = "All";
  880.                 obj = setmetatable({},{
  881.                     __newindex = function(obj,i,v)
  882.                         rawset(obj,i,v)
  883.                         pcpSignals.Seats:fire(v)
  884.                         v.Changed:connect(function()
  885.                             if not v or v.Parent == nil then
  886.                                 obj[i] = nil
  887.                                 pcpSignals.Seats:fire()
  888.                             end
  889.                         end)
  890.                     end
  891.                 });
  892.                 giveFunctionality = function(self,gui,cpart)
  893.                    
  894.                     gui.Enabled.MouseEnter:connect(function() gui.Enabled.BackgroundTransparency = .9 end)
  895.                     gui.Enabled.MouseLeave:connect(function() gui.Enabled.BackgroundTransparency = 1 end)
  896.                     gui.Enabled.MouseButton1Down:connect(function() gui.Enabled.BackgroundTransparency = .9 end)
  897.                     gui.Enabled.MouseButton1Up:connect(function() gui.Enabled.BackgroundTransparency = 1 end)
  898.                    
  899.                     if cpart == "All" then
  900.                         gui.Enabled.MouseButton1Click:connect(function()
  901.                             for _,w in pairs(self.obj) do
  902.                                 spawn(function()
  903.                                     w.Disabled = true
  904.                                     wait(.5)
  905.                                     w.Disabled = false
  906.                                 end)
  907.                             end
  908.                         end)
  909.                     else
  910.                         gui.Enabled.MouseButton1Click:connect(function()
  911.                             cpart.Disabled = true
  912.                             wait(.5)
  913.                             cpart.Disabled = false
  914.                         end)
  915.                     end
  916.                 end
  917.             };
  918.             Followers = {
  919.                 controlBy = "All";
  920.                 obj = setmetatable({},{
  921.                     __newindex = function(obj,i,v)
  922.                         rawset(obj,i,v)
  923.                         pcpSignals.Followers:fire(v)
  924.                         v.Changed:connect(function()
  925.                             if not v or v.Parent == nil then
  926.                                 obj[i] = nil
  927.                                 pcpSignals.Followers:fire()
  928.                             end
  929.                         end)
  930.                     end
  931.                 });
  932.                 giveFunctionality = function(self,gui,cpart)
  933.                     if cpart == "All" then
  934.                         gui.Enabled.MouseButton1Click:connect(function()
  935.                             if gui.Enabled.Text == "Off" then
  936.                                 gui.Enabled.Text = "On"
  937.                                 gui.Enabled.BackgroundColor3 = OverusedColors.green
  938.                                 for _,w in pairs(self.obj) do
  939.                                     w.RocketPropulsion:Fire()
  940.                                     w.Smoke.Enabled = true
  941.                                 end
  942.                             else
  943.                                 gui.Enabled.Text = "Off"
  944.                                 gui.Enabled.BackgroundColor3 = OverusedColors.red
  945.                                 for _,w in pairs(self.obj) do
  946.                                     w.RocketPropulsion:Abort()
  947.                                     w.Smoke.Enabled = false
  948.                                 end
  949.                             end
  950.                         end)
  951.                        
  952.                         local trackOthers = false
  953.                        
  954.                         gui.FY.MouseButton1Click:connect(function()
  955.                             if gui.FY.BackgroundTransparency == .9 then return end
  956.                             trackOthers = false
  957.                             gui.FY.BackgroundTransparency = .9
  958.                             gui.FO.BackgroundTransparency =  1
  959.                             for _,w in pairs(self.obj) do
  960.                                 w.RocketPropulsion.Target = plr.Character.Torso
  961.                             end
  962.                         end)
  963.                        
  964.                         gui.FO.MouseButton1Click:connect(function()
  965.                             if gui.FO.BackgroundTransparency == .9 then return end
  966.                             trackOthers = true
  967.                             gui.FY.BackgroundTransparency =  1
  968.                             gui.FO.BackgroundTransparency = .9
  969.                             for _,w in pairs(self.obj) do
  970.                                 spawn(function()
  971.                                     while w and trackOthers do
  972.                                         target = SIService.GetClosestPlayer:InvokeServer(w.Position)
  973.                                         if target and target.Character:findFirstChild("Torso") then w.RocketPropulsion.Target = target.Character.Torso end
  974.                                         wait(.5)
  975.                                     end
  976.                                 end)
  977.                             end
  978.                         end)
  979.                        
  980.                     else
  981.                         gui.Enabled.MouseButton1Click:connect(function()
  982.                             if gui.Enabled.Text == "Off" then
  983.                                 gui.Enabled.Text = "On"
  984.                                 gui.Enabled.BackgroundColor3 = OverusedColors.green
  985.                                 cpart.RocketPropulsion:Fire()
  986.                                 cpart.Smoke.Enabled = true
  987.                             else
  988.                                 gui.Enabled.Text = "Off"
  989.                                 gui.Enabled.BackgroundColor3 = OverusedColors.red
  990.                                 cpart.RocketPropulsion:Abort()
  991.                                 cpart.Smoke.Enabled = false
  992.                             end
  993.                         end)
  994.                        
  995.                         local trackOthers = false
  996.                        
  997.                         gui.FY.MouseButton1Click:connect(function()
  998.                             if gui.FY.BackgroundTransparency == .9 then return end
  999.                             trackOthers = false
  1000.                             gui.FY.BackgroundTransparency = .9
  1001.                             gui.FO.BackgroundTransparency =  1
  1002.                             cpart.RocketPropulsion.Target = plr.Character.Torso
  1003.                         end)
  1004.                        
  1005.                         gui.FO.MouseButton1Click:connect(function()
  1006.                             if gui.FO.BackgroundTransparency == .9 then return end
  1007.                             trackOthers = true
  1008.                             gui.FY.BackgroundTransparency =  1
  1009.                             gui.FO.BackgroundTransparency = .9
  1010.                             cpart.RocketPropulsion.Target = nil
  1011.                             spawn(function()
  1012.                                 while cpart and trackOthers do
  1013.                                     target = SIService.GetClosestPlayer:InvokeServer(cpart.Position)
  1014.                                     if target and target.Character:findFirstChild("Torso") then cpart.RocketPropulsion.Target = target.Character.Torso end
  1015.                                     wait(.5)
  1016.                                 end
  1017.                             end)
  1018.                         end)
  1019.                        
  1020.                         if cpart.Smoke.Enabled then
  1021.                             gui.Enabled.Text = "On"
  1022.                             gui.Enabled.BackgroundColor3 = OverusedColors.green
  1023.                         end
  1024.                        
  1025.                         if cpart.RocketPropulsion.Target then
  1026.                             if plr.Character:findFirstChild("Torso") and cpart.RocketPropulsion.Target == plr.Character.Torso then
  1027.                                 gui.FY.BackgroundTransparency = .9
  1028.                             elseif game.Players:GetPlayerFromCharacter(cpart.RocketPropulsion.Target.Parent) then
  1029.                                 gui.FO.BackgroundTransparency = .9
  1030.                             end
  1031.                         end
  1032.                     end
  1033.                 end
  1034.             };
  1035.             Stablizers = {
  1036.                 controlBy = "All";
  1037.                 obj = setmetatable({},{
  1038.                     __newindex = function(obj,i,v)
  1039.                         rawset(obj,i,v)
  1040.                         pcpSignals.Stablizers:fire(v)
  1041.                         v.Changed:connect(function()
  1042.                             if not v or v.Parent == nil then
  1043.                                 obj[i] = nil
  1044.                                 pcpSignals.Stablizers:fire()
  1045.                             end
  1046.                         end)
  1047.                     end
  1048.                 });
  1049.                 giveFunctionality = function(self,gui,cpart)
  1050.                     if cpart == "All" then
  1051.                         gui.Enabled.MouseButton1Click:connect(function()
  1052.                             for _,w in pairs(self.obj) do
  1053.                                 if gui.Enabled.GradientBlocks.Visible then
  1054.                                     w.BodyGyro.D = 0
  1055.                                     w.BodyGyro.P = 0
  1056.                                     w.SelectionBox.Transparency = 1
  1057.                                 else
  1058.                                     w.BodyGyro.D = PartLimits.GyroD
  1059.                                     w.BodyGyro.P = PartLimits.GyroP
  1060.                                     w.SelectionBox.Transparency = 0
  1061.                                 end
  1062.                             end
  1063.                             gui.Enabled.GradientBlocks.Visible = not gui.Enabled.GradientBlocks.Visible
  1064.                         end)
  1065.                     else
  1066.                         gui.Enabled.MouseButton1Click:connect(function()
  1067.                             if gui.Enabled.GradientBlocks.Visible then
  1068.                                 cpart.BodyGyro.D = 0
  1069.                                 cpart.BodyGyro.P = 0
  1070.                                 cpart.SelectionBox.Transparency = 1
  1071.                             else
  1072.                                 cpart.BodyGyro.D = PartLimits.GyroD
  1073.                                 cpart.BodyGyro.P = PartLimits.GyroP
  1074.                                 cpart.SelectionBox.Transparency = 0
  1075.                             end
  1076.                             gui.Enabled.GradientBlocks.Visible = not gui.Enabled.GradientBlocks.Visible
  1077.                         end)
  1078.                         if cpart.SelectionBox.Transparency == 1 then gui.Enabled.GradientBlocks.Visible = false end
  1079.                     end
  1080.                 end
  1081.             };
  1082.         }
  1083.        
  1084.         workspace.ChildAdded:connect(function(child)
  1085.             if string.sub(child.Name,1,1) == tostring(_G.Team.Value) then
  1086.                 local class = string.sub(child.Name,2,2)
  1087.                 if class == "H" then
  1088.                     pcpSettings.Hovers.obj[child] = child
  1089.                 elseif class == "X" or class == "Y" or class == "Z" then
  1090.                     pcpSettings.Thrusters.obj[child] = child
  1091.                 elseif class == "L" then
  1092.                     pcpSettings.Lights.obj[child] = child
  1093.                 elseif class == "F" then
  1094.                     pcpSettings.Followers.obj[child] = child
  1095.                 elseif class == "S" then
  1096.                     pcpSettings.Stablizers.obj[child] = child
  1097.                 elseif child:IsA("VehicleSeat" or "Seat") then
  1098.                     pcpSettings.Seats.obj[child] = child
  1099.                 end
  1100.             end
  1101.         end)
  1102.        
  1103.         local function OpenPanel()
  1104.             local box = game.ReplicatedStorage.PCPgui
  1105.             local pcp = box.PartsControlPanel:Clone()
  1106.             pcp.Position = UDim2.new(1,0,0,0)
  1107.             local cby = pcp.Control
  1108.             local scroll = pcp.Scroller
  1109.             local allocatedspace = 1.5
  1110.             IsOutCP = true
  1111.            
  1112.             local function RecalculatePositions()
  1113.                 local cSizeY = 0
  1114.                 for index,w in pairs(scroll:GetChildren()) do
  1115.                     local sizer = index ~= 1 and scroll:GetChildren()[index - 1].Size.Y.Offset or 0
  1116.                     local start = index ~= 1 and scroll:GetChildren()[index - 1].Position.Y.Offset or 0
  1117.                     local other = index ~= 1 and scroll:GetChildren()[index - 1].Window.Size.Y.Scale or 0
  1118.                     w.Position = UDim2.new(0,0,0,start + sizer + (sizer * other))
  1119.                     cSizeY = cSizeY + (w.AbsoluteSize.y + (w.AbsoluteSize.y * w.Window.Size.Y.Scale))
  1120.                 end
  1121.                 scroll.CanvasSize = UDim2.new(0,0,0,cSizeY)
  1122.             end
  1123.            
  1124.             pcp.Parent = opt.Parent
  1125.             for _,w in pairs(pcpSettings) do
  1126.                 cby[_][w.controlBy].BackgroundTransparency = .9
  1127.                 local gui = box.Gui:Clone()
  1128.                 gui.Name = _
  1129.                 gui.Text = _.."("..getlength(w.obj)..")"
  1130.                 gui.Parent = scroll
  1131.                
  1132.                 gui.Window.Changed:connect(function(prop)
  1133.                     if (prop ~= "AbsoluteSize" and prop ~= "AbsolutePosition") then return end
  1134.                     RecalculatePositions()
  1135.                 end)
  1136.                
  1137.                 local updateCount = pcpSignals[_]:connect(function()
  1138.                     gui.Text = _.."("..getlength(w.obj)..")"
  1139.                 end)
  1140.                
  1141.                 local function UpdateControlBy()
  1142.                     gui.Window.Parts:ClearAllChildren()
  1143.                     if pcpConnections.CreateNewGui then
  1144.                         pcpConnections.CreateNewGui:disconnect()
  1145.                         pcpConnections.CreateNewGui = nil
  1146.                     end
  1147.                     if w.controlBy == "All" then
  1148.                         local fgui = box[_]:Clone()
  1149.                         fgui.NOC.Text = "All ".._
  1150.                         w.giveFunctionality(w,fgui,"All")
  1151.                        
  1152.                         local reticle = {}
  1153.                        
  1154.                         fgui.MouseEnter:connect(function()
  1155.                             plr.PlayerGui.Reticles:ClearAllChildren()
  1156.                             local argument = {}
  1157.                             for q,qq in pairs(w.obj) do
  1158.                                 table.insert(argument,qq)
  1159.                             end
  1160.                             reticle = SIService.CreateReticle:InvokeServer(argument)
  1161.                         end)
  1162.                        
  1163.                         fgui.MouseLeave:connect(function()
  1164.                             for _,w in pairs(reticle) do
  1165.                                 w:remove()
  1166.                             end
  1167.                             reticle = {}
  1168.                         end)
  1169.                        
  1170.                         fgui.Parent = gui.Window.Parts
  1171.                         gui.Window:TweenSize(UDim2.new(1,0,allocatedspace,0),"Out","Quad",.2,true)
  1172.                     elseif w.controlBy == "Individual" then
  1173.                         for index,part in pairs(w.obj) do
  1174.                             local fgui = box[_]:Clone()
  1175.                             fgui.NOC.Text = string.sub(_,1,string.len(_)-1).." "..#gui.Window.Parts:GetChildren()+1
  1176.                             w.giveFunctionality(w,fgui,part)
  1177.                             fgui.Size = UDim2.new(1,0,1/getlength(w.obj),0)
  1178.                             fgui.Position = UDim2.new(0,0,1/getlength(w.obj)*#gui.Window.Parts:GetChildren(),0)
  1179.                            
  1180.                             local reticle
  1181.                            
  1182.                             fgui.MouseEnter:connect(function()
  1183.                                 plr.PlayerGui.Reticles:ClearAllChildren()
  1184.                                 reticle = SIService.CreateReticle:InvokeServer(part)
  1185.                             end)
  1186.                            
  1187.                             fgui.MouseLeave:connect(function()
  1188.                                 if reticle then reticle:remove() reticle = nil end
  1189.                             end)
  1190.                            
  1191.                             fgui.Parent = gui.Window.Parts
  1192.                             spawn(function()
  1193.                                 repeat wait() until not part or part.Parent == nil
  1194.                                 fgui:remove()
  1195.                                 if not gui or not gui.Parent then return end
  1196.                                 for pos,PCGUI in pairs(gui.Window.Parts:GetChildren()) do
  1197.                                     PCGUI:TweenSizeAndPosition(UDim2.new(1,0,1/getlength(w.obj),0),UDim2.new(0,0,1/getlength(w.obj)*(pos-1),0),"Out","Quad",.2,true)
  1198.                                 end
  1199.                                 gui.Window:TweenSize(UDim2.new(1,0,allocatedspace*getlength(w.obj),0),"Out","Quad",.2,true)
  1200.                             end)
  1201.                         end
  1202.                         pcpConnections.CreateNewGui = pcpSignals[_]:connect(function(part)
  1203.                             if not part then return end
  1204.                             local fgui = box[_]:Clone()
  1205.                             fgui.NOC.Text = string.sub(_,1,string.len(_)-1).." "..#gui.Window:GetChildren()+1
  1206.                             w.giveFunctionality(w,fgui,part)
  1207.                             fgui.Size = UDim2.new(1,0,0,0)
  1208.                             fgui.Position = UDim2.new(0,0,1,0)
  1209.                            
  1210.                             local reticle
  1211.                            
  1212.                             fgui.MouseEnter:connect(function()
  1213.                                 plr.PlayerGui.Reticles:ClearAllChildren()
  1214.                                 reticle = SIService.CreateReticle:InvokeServer(part)
  1215.                             end)
  1216.                            
  1217.                             fgui.MouseLeave:connect(function()
  1218.                                 if reticle then reticle:remove() reticle = nil end
  1219.                             end)
  1220.                            
  1221.                             fgui.Parent = gui.Window.Parts
  1222.                             for pos,PCGUI in pairs(gui.Window.Parts:GetChildren()) do
  1223.                                 PCGUI:TweenSizeAndPosition(UDim2.new(1,0,1/getlength(w.obj),0),UDim2.new(0,0,1/getlength(w.obj)*(pos-1),0),"Out","Quad",.2,true)
  1224.                             end
  1225.                             gui.Window:TweenSize(UDim2.new(1,0,allocatedspace*getlength(w.obj),0),"Out","Quad",.2,true)
  1226.                         end)
  1227.                         gui.Window:TweenSize(UDim2.new(1,0,allocatedspace*getlength(w.obj),0),"Out","Quad",.2,true)
  1228.                     elseif w.controlBy == "Section" then
  1229.                         local translate = {"X","Y","Z"}
  1230.                         for section = 1,3 do
  1231.                             local fgui = box[_]:Clone()
  1232.                             fgui.NOC.Text = "Section "..section
  1233.                             w.giveFunctionality(w,fgui,translate[section])
  1234.                             fgui.Size = UDim2.new(1,0,1/#translate,0)
  1235.                             fgui.Position = UDim2.new(0,0,1/#translate*(section-1),0)
  1236.                            
  1237.                             local reticle = {}
  1238.                            
  1239.                             fgui.MouseEnter:connect(function()
  1240.                                 plr.PlayerGui.Reticles:ClearAllChildren()
  1241.                                 local qqq = {}
  1242.                                 for _,w in pairs(w.obj) do
  1243.                                     if string.sub(w.Name,2,2) == translate[section] then table.insert(qqq,w) end
  1244.                                 end
  1245.                                 reticle = SIService.CreateReticle:InvokeServer(qqq)
  1246.                             end)
  1247.                            
  1248.                             fgui.MouseLeave:connect(function()
  1249.                                 for _,w in pairs(reticle) do
  1250.                                     w:remove()
  1251.                                 end
  1252.                                 reticle = {}
  1253.                             end)
  1254.                            
  1255.                             fgui.Parent = gui.Window.Parts
  1256.                         end
  1257.                         gui.Window:TweenSize(UDim2.new(1,0,allocatedspace*#translate,0),"Out","Quad",.2,true)
  1258.                     end
  1259.                 end
  1260.                
  1261.                 for __,x in pairs(cby[_]:GetChildren()) do
  1262.                     x.MouseButton1Click:connect(function()
  1263.                         if x.BackgroundTransparency == .9 then return end
  1264.                         for __,y in pairs(cby[_]:GetChildren()) do
  1265.                             y.BackgroundTransparency = 1
  1266.                         end
  1267.                         w.controlBy = x.Name
  1268.                         x.BackgroundTransparency = .9
  1269.                         UpdateControlBy()
  1270.                     end)
  1271.                     UpdateControlBy()
  1272.                 end
  1273.             end
  1274.             RecalculatePositions()
  1275.             pcp:TweenPosition(UDim2.new(0,0,0,0),"Out","Quad",.3,true)
  1276.         end
  1277.        
  1278.         local function ClosePanel()
  1279.             IsOutCP = false
  1280.             local panel = opt.Parent:findFirstChild("PartsControlPanel")
  1281.             plr.PlayerGui.Reticles:ClearAllChildren()
  1282.             if panel then
  1283.                 panel:TweenPosition(UDim2.new(1,0,0,0),"Out","Quad",.3,true,function() panel:remove() end)
  1284.                 wait(.3)
  1285.             end
  1286.         end
  1287.        
  1288.         local function OpenInterface()
  1289.             game.StarterGui:SetCoreGuiEnabled("PlayerList",false)
  1290.             interface:TweenPosition(UDim2.new(.8,0,0,0),"Out","Quad",.2,true)
  1291.         end
  1292.        
  1293.         local function CloseInterface()
  1294.             game.StarterGui:SetCoreGuiEnabled("PlayerList",true)
  1295.             interface:TweenPosition(UDim2.new(1,0,0,0),"Out","Quad",.2,true)
  1296.         end
  1297.        
  1298.         local tasks = interface.Tasks
  1299.         local function GenNotification(message,color,box,lifetime)
  1300.             if not message or not color or not box then return end
  1301.             local note = game.ReplicatedStorage.TaskbarBox.Note:Clone()
  1302.             note.Position = UDim2.new(1,0,0,0)
  1303.             note.Text = message
  1304.             note.BackgroundColor3 = color
  1305.             note.Parent = box
  1306.             note:TweenPosition(UDim2.new(0,0,0,0),"Out","Linear",.3,true,function()
  1307.                 wait(lifetime or 3)
  1308.                 note:TweenPosition(UDim2.new(1,0,note.Position.Y.Scale,0),"Out","Linear",.3,true,function()
  1309.                     note:remove()
  1310.                 end)
  1311.             end)
  1312.             return note
  1313.         end
  1314.            
  1315.         local offset = 10
  1316.         local taskfunctions = {
  1317.             Options = {desc = "Options"; buttonfunction = function(button,notebox)
  1318.                 if IsOutCP then ClosePanel() end
  1319.                 if IsOut then closeOptions() CloseInterface() else OpenInterface() openOptions() end
  1320.             end};
  1321.             RetrieveTools = {desc = "Toggle Tools"; buttonfunction = function(button,notebox)
  1322.                 if not SIService.IsInGarage:InvokeServer(_G.Team.Value) and not _G.GetCGPermissions().enablebuildingtools then GenNotification("No Tools Area",ConvertColor3(Color3.new(255,0,0)),notebox) return end
  1323.                 game.StarterGui:SetCoreGuiEnabled("Backpack",not game.StarterGui:GetCoreGuiEnabled("Backpack"))
  1324.             end};
  1325.             ControlParts = {desc = "Part Control Panel"; buttonfunction = function(button,notebox)
  1326.                 if IsOut then closeOptions() end
  1327.                 if IsOutCP then ClosePanel() CloseInterface() else OpenInterface() OpenPanel() end
  1328.             end};
  1329.         }
  1330.            
  1331.         for _,w in pairs(tasks:GetChildren()) do
  1332.             local notebox = game.ReplicatedStorage.TaskbarBox.NotificationBox:Clone()
  1333.             local bsize = w.Size
  1334.             local bpos = w.Position
  1335.             notebox.Parent = w
  1336.                
  1337.             local note = game.ReplicatedStorage.TaskbarBox.Note:Clone()
  1338.             note.Position = UDim2.new(1,0,0,0)
  1339.             if taskfunctions[w.Name] then note.Text = taskfunctions[w.Name].desc end
  1340.             note.ZIndex = 10
  1341.             note.Parent = notebox
  1342.            
  1343.             w.MouseEnter:connect(function()
  1344.                 if w.Rotation ~= 0 or note.Position == UDim2.new(0,0,0,0) then return end
  1345.                 note.Visible = true
  1346.                 w.Size = bsize + UDim2.new(0,offset,0,offset)
  1347.                 w.Position = bpos - UDim2.new(0,offset/2,0,offset/2)
  1348.                 swipesfx:Play()
  1349.                 note:TweenPosition(UDim2.new(0,0,0,0),"Out","Linear",.15,true)
  1350.             end)
  1351.            
  1352.             w.MouseLeave:connect(function()
  1353.                 w.Size = bsize
  1354.                 w.Position = bpos
  1355.                 note.Position = UDim2.new(1,0,0,0)
  1356.                 note.Visible = false
  1357.             end)
  1358.            
  1359.             w.MouseButton1Click:connect(function()
  1360.                 if taskfunctions[w.Name] and taskfunctions[w.Name].buttonfunction then clicksfx:Play()  taskfunctions[w.Name].buttonfunction(w,notebox) end
  1361.             end)
  1362.         end
  1363.        
  1364.         opt.Position = UDim2.new(1,0,0,0)
  1365.         interface.Position = UDim2.new(1,0,0,0)
  1366.     end;
  1367.    
  1368.     QuickAccess = function(gui)
  1369.         local buttonfunctions = {
  1370.             GarageControls = function(button)
  1371.                 local frame = button.GarageControls
  1372.                 local framesize = frame.Size
  1373.                 local door = workspace.Map.Garages.Garages["Garage".._G.Team.Value].Door
  1374.                 local ceiling = door.Parent.Top
  1375.                 local qfloor = door.Parent.Bottom
  1376.                 local P = Vector3.new(door.Position.X,door.Position.Y - door.Size.Y/2,door.Position.Z)
  1377.                 local S = door.Size
  1378.                
  1379.                 local buttonfunctions = {
  1380.                     ["Open/Close Garage"] = function(button)
  1381.                         local open = false
  1382.                         local rotation = CFrame.Angles(door.CFrame:toEulerAnglesXYZ())
  1383.                         button.MouseButton1Click:connect(function()
  1384.                             if not button.Active then return end
  1385.                             clicksfx:Play()
  1386.                             button.Active = false
  1387.                             if not open then
  1388.                                 button.Text = "Opening..."
  1389.                                 button.BackgroundColor3 = ConvertColor3(Color3.new(0,255,127))
  1390.                                 open = not open
  1391.                                 local OS = Instance.new("Sound",door)
  1392.                                 OS.SoundId = "rbxassetid://142643714"
  1393.                                 OS.Pitch = 4
  1394.                                 OS.Volume = .2
  1395.                                 OS:Play()
  1396.                                 for i = 1,0,-.1 do
  1397.                                     button.BackgroundTransparency = i
  1398.                                     door.Size = Vector3.new(S.X,S.Y * i,S.Z)
  1399.                                     door.CFrame = CFrame.new(P.X,P.Y + door.Size.Y/2,P.Z) * rotation
  1400.                                     wait(.1)
  1401.                                 end
  1402.                                 button.Text = "Open/Close Garage"
  1403.                                 button.BackgroundColor3 = ConvertColor3(Color3.new(255,255,255))
  1404.                                 button.BackgroundTransparency = .9
  1405.                                 OS:remove()
  1406.                             else
  1407.                                 local CS = Instance.new("Sound",door)
  1408.                                 CS.SoundId = "rbxassetid://142643742"
  1409.                                 CS.Pitch = 4
  1410.                                 CS.Volume = .2
  1411.                                 CS:Play()
  1412.                                 button.Text = "Closing..."
  1413.                                 button.BackgroundColor3 = ConvertColor3(Color3.new(255,85,127))
  1414.                                 open = not open
  1415.                                 for i = 0,1,.05 do
  1416.                                     button.BackgroundTransparency = 1 - i
  1417.                                     door.Size = Vector3.new(S.X,S.Y * (i + .05),S.Z)
  1418.                                     door.CFrame = CFrame.new(P.X,P.Y + door.Size.Y/2,P.Z) * rotation
  1419.                                     wait()
  1420.                                 end
  1421.                                 button.Text = "Open/Close Garage"
  1422.                                 button.BackgroundColor3 = ConvertColor3(Color3.new(255,255,255))
  1423.                                 button.BackgroundTransparency = .9
  1424.                                 CS:remove()
  1425.                             end
  1426.                             button.Active = true
  1427.                         end)
  1428.                     end;
  1429.                    
  1430.                     ["Transparent"] = function(button)
  1431.                         button = button.Box
  1432.                         button.MouseButton1Click:connect(function()
  1433.                             button.Active = false
  1434.                             if button.Text == "X" then
  1435.                                 button.Text = ""
  1436.                                 for i = .5,0,-.05 do
  1437.                                     door.Transparency = i
  1438.                                     run.RenderStepped:wait()
  1439.                                 end
  1440.                             else
  1441.                                 button.Text = "X"
  1442.                                 for i = 0,.5,.05 do
  1443.                                     door.Transparency = i
  1444.                                     run.RenderStepped:wait()
  1445.                                 end
  1446.                             end
  1447.                             button.Active = true
  1448.                         end)
  1449.                     end;
  1450.                    
  1451.                     ["Retracted Back"] = function(button)
  1452.                         button = button.Box
  1453.                         button.MouseButton1Click:connect(function()
  1454.                             button.Active = false
  1455.                             if button.Text == "X" then
  1456.                                 button.Text = ""
  1457.                                 SIService.FireMotor:FireServer("Back",false)
  1458.                             else
  1459.                                 button.Text = "X"
  1460.                                 SIService.FireMotor:FireServer("Back",true)
  1461.                             end
  1462.                             button.Active = true
  1463.                         end)
  1464.                     end;
  1465.                    
  1466.                     ["Ceiling Off"] = function(button)
  1467.                         button = button.Box
  1468.                         local pos = ceiling.Position
  1469.                         local angles = CFrame.Angles(ceiling.CFrame:toEulerAnglesXYZ())
  1470.                         button.MouseButton1Click:connect(function()
  1471.                             button.Active = false
  1472.                             local sfx = Instance.new("Sound",ceiling)
  1473.                             sfx.SoundId = "rbxassetid://147627083"
  1474.                             sfx.Volume = 1
  1475.                             sfx:Play()
  1476.                             if button.Text == "X" then
  1477.                                 button.Text = ""
  1478.                                 ceiling.CanCollide = false
  1479.                                 ceiling.CFrame = CFrame.new(pos + Vector3.new(0,1000,0)) * angles
  1480.                                 for i = 1,0,-.1 do
  1481.                                     ceiling.CFrame = CFrame.new(pos + Vector3.new(0,100*i,0)) * angles
  1482.                                     ceiling.Transparency = i
  1483.                                     wait()
  1484.                                 end
  1485.                                 ceiling.CanCollide = true
  1486.                             else
  1487.                                 button.Text = "X"
  1488.                                 ceiling.CanCollide = false
  1489.                                 for i = 0,1,.1 do
  1490.                                     ceiling.CFrame = CFrame.new(pos + Vector3.new(0,100*i,0)) * angles
  1491.                                     ceiling.Transparency = i
  1492.                                     wait()
  1493.                                 end
  1494.                                 ceiling.CFrame = CFrame.new(1000000,1000000,1000000) * angles
  1495.                             end
  1496.                             sfx:remove()
  1497.                             button.Active = true
  1498.                         end)
  1499.                     end;
  1500.                 }
  1501.                
  1502.                
  1503.                 for _,w in pairs(frame:GetChildren()) do
  1504.                     if buttonfunctions[w.Name] then
  1505.                         buttonfunctions[w.Name](w)
  1506.                     end
  1507.                 end
  1508.                
  1509.                 local isout = false
  1510.                 button.MouseButton1Click:connect(function()
  1511.                     clicksfx:Play()
  1512.                     if not isout then
  1513.                         isout = not isout
  1514.                         button.ButtonImg.ImageColor3 = Color3.new(0,0,0)
  1515.                         for k,w in pairs(frame:GetChildren()) do
  1516.                             spawn(function()
  1517.                                 wait(.2 + (k * .1))
  1518.                                 w:TweenPosition(UDim2.new(0,0,w.Position.Y.Scale,0),"Out","Quad",.1,true)
  1519.                                 swipesfx2:Play()
  1520.                             end)
  1521.                         end
  1522.                         frame:TweenSize(UDim2.new(framesize.X.Scale,0,framesize.Y.Scale,0),"Out","Quad",.2,true)
  1523.                         swipesfx2:Play()
  1524.                     else
  1525.                         isout = not isout
  1526.                         button.ButtonImg.ImageColor3 = Color3.new(1,1,1)
  1527.                         for k,w in pairs(frame:GetChildren()) do
  1528.                             spawn(function()
  1529.                                 wait((.1 * #frame:GetChildren()) - k * .1)
  1530.                                 w:TweenPosition(UDim2.new(-1,0,w.Position.Y.Scale,0),"Out","Quad",.1,true)
  1531.                                 swipesfx2:Play()
  1532.                             end)
  1533.                         end
  1534.                         wait(.1 * #frame:GetChildren() + .2)
  1535.                         frame:TweenSize(UDim2.new(framesize.X.Scale,0,0,0),"Out","Quad",.2,true)
  1536.                         swipesfx2:Play()
  1537.                     end
  1538.                 end)
  1539.                
  1540.                 frame.Size = UDim2.new(framesize.X.Scale,0,0,0)
  1541.                 for _,w in pairs(frame:GetChildren()) do
  1542.                     w.Position = UDim2.new(-1,0,w.Position.Y.Scale,0)
  1543.                 end
  1544.             end;
  1545.            
  1546.             TrustSystem = function(button)
  1547.                 local currentwindow
  1548.                
  1549.                 button.MouseButton1Click:connect(function()
  1550.                     if currentwindow then return end
  1551.                     button.ButtonImg.ImageColor3 = Color3.new(0,0,0)
  1552.                     local manager = game.ReplicatedStorage.Miscellaneous["Trust Manager"]:Clone()
  1553.                     local F11 = manager.FullScreenUI
  1554.                     local pf = manager.PermissionsFrame
  1555.                     local plrframe = manager.PlayerFrame
  1556.                     local plrlist = plrframe.PlayerList
  1557.                    
  1558.                     local OverrideByFilter = false
  1559.                    
  1560.                     function InitializeClick(tab)
  1561.                         tab.MouseButton1Click:connect(function()
  1562.                             if tab.BackgroundTransparency == 0 then tab.BackgroundTransparency = 1 pf.PlayerPermissions:remove() return end
  1563.                             for _,w in pairs(plrlist:GetChildren()) do
  1564.                                 w.BackgroundTransparency = 1
  1565.                             end
  1566.                             tab.BackgroundTransparency = 0
  1567.                             if pf:findFirstChild("PlayerPermissions") then pf.PlayerPermissions:remove() end
  1568.                             local plr = game.Players[tab.Name]
  1569.                             local plrpf = game.ReplicatedStorage.Miscellaneous.PlayerPermissions:Clone()
  1570.                            
  1571.                             tab.Changed:connect(function(prop)
  1572.                                 if prop == "Parent" then
  1573.                                     if tab.Parent == nil then plrpf:remove() end
  1574.                                 end
  1575.                             end)
  1576.                            
  1577.                             function UpdatePermissions(plr)
  1578.                                 SIService.SetPermissions:FireServer(plr,{enableforcefield = plrpf.AllowForceFielding.Box.Text == "X" and true or false; enablebuildingtools = plrpf.AllowBuilding.Box.Text == "X" and true or false; blockplayer = plrpf.BlockPlayer.Box.Text == "X" and true or false;})
  1579.                             end
  1580.                                
  1581.                             plrpf.PlayerImg.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=200&y=200&Format=Png&username="..plr.Name
  1582.                             local cp = SIService.GetPermissions:InvokeServer(plr)
  1583.                            
  1584.                             local aff = plrpf.AllowForceFielding
  1585.                             local ab = plrpf.AllowBuilding
  1586.                             local bp = plrpf.BlockPlayer
  1587.                             local stpr = plrpf.SendTPRequest
  1588.                            
  1589.                             aff.Box.Text = cp.enableforcefield and "X" or ""
  1590.                             ab.Box.Text = cp.enablebuildingtools and "X" or ""
  1591.                             bp.Box.Text = cp.blockplayer and "X" or ""
  1592.                            
  1593.                             aff.Box.MouseButton1Click:connect(function()
  1594.                                 aff.Box.Text = aff.Box.Text == "X" and "" or "X"
  1595.                                 UpdatePermissions(plr)
  1596.                             end)
  1597.                             ab.Box.MouseButton1Click:connect(function()
  1598.                                 ab.Box.Text = ab.Box.Text == "X" and "" or "X"
  1599.                                 UpdatePermissions(plr)
  1600.                             end)
  1601.                             bp.Box.MouseButton1Click:connect(function()
  1602.                                 bp.Box.Text = bp.Box.Text == "X" and "" or "X"
  1603.                                 UpdatePermissions(plr)
  1604.                             end)
  1605.                            
  1606.                             local function Perform()
  1607.                                 SIService.LoadCharacter:FireServer(plr)
  1608.                             end
  1609.                            
  1610.                             plrpf.SendTPRequest.Box.MouseButton1Click:connect(function()
  1611.                                 SIService.SendNotification:FireServer(plr,game.Players.LocalPlayer.Name.." wants you to teleport to their location.","RequestTeleport")
  1612.                             end)
  1613.                            
  1614.                             plrpf.KickPlayer.Box.MouseButton1Click:connect(Perform)
  1615.                             if not game.ReplicatedStorage.GarageDetection["Garage".._G.Team.Value]:findFirstChild(plr.Name) then plrpf.KickPlayer.Visible = false end
  1616.                            
  1617.                             game.ReplicatedStorage.GarageDetection["Garage".._G.Team.Value].ChildAdded:connect(function(child)
  1618.                                 if child.Name == plr.Name and plrpf:findFirstChild("KickPlayer") then plrpf.KickPlayer.Visible = true end
  1619.                             end)
  1620.                             game.ReplicatedStorage.GarageDetection["Garage".._G.Team.Value].ChildRemoved:connect(function(child)
  1621.                                 if child.Name == plr.Name and plrpf:findFirstChild("KickPlayer") then plrpf.KickPlayer.Visible = false end
  1622.                             end)
  1623.                            
  1624.                             plrpf.OtherOptions["Reset Permissions"].MouseButton1Click:connect(function()
  1625.                                 aff.Box.Text = ""
  1626.                                 ab.Box.Text = ""
  1627.                                 bp.Box.Text = ""
  1628.                                 UpdatePermissions(plr)
  1629.                             end)
  1630.                             plrpf.Parent = pf
  1631.                         end)
  1632.                     end
  1633.                    
  1634.                     local function RefreshWP()
  1635.                         plrlist:ClearAllChildren()
  1636.                         for _,w in pairs(game.Players:GetPlayers()) do
  1637.                             if w ~= game.Players.LocalPlayer then
  1638.                                 local plrtab = game.ReplicatedStorage.Miscellaneous.PlayerLabel:Clone()
  1639.                                 plrtab.Name = w.Name
  1640.                                 plrtab.Text = w.Name
  1641.                                 plrtab.Position = UDim2.new(-1,0,.125 * #plrlist:GetChildren(),0)
  1642.                                 plrtab.Parent = plrlist
  1643.                                 plrtab:TweenPosition(plrtab.Position + UDim2.new(1,0,0,0),"Out","Linear",.1,true)
  1644.                                 InitializeClick(plrtab)
  1645.                             end
  1646.                         end
  1647.                     end
  1648.                    
  1649.                     currentwindow = _G.LaunchWindow(manager)
  1650.                     RefreshWP()
  1651.                    
  1652.                     game.Players.ChildAdded:connect(function(plr)
  1653.                         if not plrlist then return end
  1654.                         if OverrideByFilter or not plr:IsA("Player") then return end
  1655.                         local plrtab = game.ReplicatedStorage.Miscellaneous.PlayerLabel:Clone()
  1656.                         plrtab.Name = plr.Name
  1657.                         plrtab.Text = plr.Name
  1658.                         plrtab.Position = UDim2.new(-1,0,.125 * #plrlist:GetChildren(),0)
  1659.                         plrtab.Parent = plrlist
  1660.                         plrtab:TweenPosition(plrtab.Position + UDim2.new(1,0,0,0),"Out","Linear",.1,true)
  1661.                         InitializeClick(plrtab)
  1662.                     end)
  1663.                    
  1664.                     game.Players.ChildRemoved:connect(function(plr)
  1665.                         if OverrideByFilter or not plr:IsA("Player") or not plrlist then return end
  1666.                         plrlist[plr.Name]:remove()
  1667.                         for _,w in pairs(plrlist:GetChildren()) do
  1668.                             w:TweenPosition(UDim2.new(0,0, .125 * (_ - 1),0),"Out","Linear",.1,true)
  1669.                         end
  1670.                     end)
  1671.                    
  1672.                     local childaddconnection
  1673.                     local childremoveconnection
  1674.                    
  1675.                     plrframe.Filtering.Box.MouseButton1Click:connect(function()
  1676.                         local box = plrframe.Filtering.Box
  1677.                         if box.Text == "" then
  1678.                             OverrideByFilter = true
  1679.                             box.Text = "X"
  1680.                             plrlist:ClearAllChildren()
  1681.                             for _,w in pairs(game.ReplicatedStorage.GarageDetection["Garage".._G.Team.Value]:GetChildren()) do
  1682.                                 if w.Name ~= game.Players.LocalPlayer.Name then
  1683.                                     local plrtab = game.ReplicatedStorage.Miscellaneous.PlayerLabel:Clone()
  1684.                                     plrtab.Name = w.Name
  1685.                                     plrtab.Text = w.Name
  1686.                                     plrtab.Position = UDim2.new(-1,0,.125 * #plrlist:GetChildren(),0)
  1687.                                     plrtab.Parent = plrlist
  1688.                                     plrtab:TweenPosition(plrtab.Position + UDim2.new(1,0,0,0),"Out","Linear",.1,true)
  1689.                                     InitializeClick(plrtab)
  1690.                                 end
  1691.                             end
  1692.                             childaddconnection = game.ReplicatedStorage.GarageDetection["Garage".._G.Team.Value].ChildAdded:connect(function(child)
  1693.                                 if child.Name == game.Players.LocalPlayer.Name then return end
  1694.                                 local plrtab = game.ReplicatedStorage.Miscellaneous.PlayerLabel:Clone()
  1695.                                 plrtab.Name = child.Name
  1696.                                 plrtab.Text = child.Name
  1697.                                 plrtab.Position = UDim2.new(-1,0,.125 * #plrlist:GetChildren(),0)
  1698.                                 plrtab.Parent = plrlist
  1699.                                 plrtab:TweenPosition(plrtab.Position + UDim2.new(1,0,0,0),"Out","Linear",.1,true)
  1700.                                 InitializeClick(plrtab)
  1701.                             end)
  1702.                             childremoveconnection = game.ReplicatedStorage.GarageDetection["Garage".._G.Team.Value].ChildRemoved:connect(function(child)
  1703.                                 if child.Name == game.Players.LocalPlayer.Name then return end
  1704.                                 plrlist[child.Name]:remove()
  1705.                                 for _,w in pairs(plrlist:GetChildren()) do
  1706.                                     w:TweenPosition(UDim2.new(0,0, .125 * (#plrlist:GetChildren()-1),0),"Out","Linear",.2,true)
  1707.                                 end
  1708.                             end)
  1709.                         else
  1710.                             box.Text = ""
  1711.                             childaddconnection:disconnect()
  1712.                             childremoveconnection:disconnect()
  1713.                             RefreshWP()
  1714.                             OverrideByFilter = false
  1715.                            
  1716.                         end
  1717.                     end)
  1718.                     repeat wait() until not currentwindow or currentwindow.Parent == nil
  1719.                     currentwindow = nil
  1720.                     button.ButtonImg.ImageColor3 = Color3.new(1,1,1)
  1721.                 end)
  1722.             end;
  1723.            
  1724.             Notifications = function(button)
  1725.                 local n = button.Notifications
  1726.                 local nsize = n.Size
  1727.                 local npos = n.Position
  1728.                 local sf = n.ScrollingFrame
  1729.                 local image = button.Circle
  1730.                 local dys = .25
  1731.                
  1732.                 local function Recalculate()
  1733.                     local newCS = #sf:GetChildren() * .25 > 1 and #sf:GetChildren() * .25 or 1
  1734.                     sf.CanvasSize = UDim2.new(0,0,newCS,0)
  1735.                     for k,w in pairs(sf:GetChildren()) do
  1736.                         w:TweenSizeAndPosition(UDim2.new(1,-13,dys / newCS,0),UDim2.new(0,0,dys / newCS * (k-1),0),"Out","Quad",.3,true)
  1737.                     end
  1738.                     image.Visible = (#sf:GetChildren() > 0 and true or false)
  1739.                     image.Amount.Text = (#sf:GetChildren() < 99 and #sf:GetChildren() or "99+")
  1740.                     n.None.Visible = (#sf:GetChildren() == 0 and true or false)
  1741.                 end
  1742.                
  1743.                 sf.ChildAdded:connect(Recalculate)
  1744.                 sf.ChildRemoved:connect(Recalculate)
  1745.                
  1746.                 SIService.SendNotification.OnClientEvent:connect(function(note)
  1747.                     note.Size = UDim2.new(1,-13,0,0)
  1748.                     note.Position = UDim2.new(0,0,dys / sf.CanvasSize.Y.Scale * #sf:GetChildren(),0)
  1749.                     note.Parent = sf
  1750.                     notifysfx:Play()
  1751.                 end)
  1752.                
  1753.                 Recalculate()
  1754.                 n.Size = UDim2.new(nsize.X.Scale,0,0,0)
  1755.                 n.Visible = false
  1756.                 button.MouseButton1Click:connect(function()
  1757.                     if not n.Visible then
  1758.                         n.Visible = true
  1759.                         n:TweenSize(nsize,"Out","Linear",.15,true)
  1760.                         button.ButtonImg.ImageColor3 = Color3.new(0,0,0)
  1761.                     else
  1762.                         n:TweenSize(UDim2.new(nsize.X.Scale,0,0,0),"Out","Linear",.15,true,function() n.Visible = false end)
  1763.                         button.ButtonImg.ImageColor3 = Color3.new(1,1,1)
  1764.                     end
  1765.                 end)
  1766.             end;
  1767.            
  1768.             SaveSystem = function(button)
  1769.                 local box = game.ReplicatedStorage.SLUI
  1770.                 local system
  1771.                
  1772.                 local Hierarchy = {
  1773.                     CSL = "SaveLoad";
  1774.                     TransactionManager = "SaveLoad";
  1775.                     SaveLoad = "Main";
  1776.                 }
  1777.                
  1778.                 local closeSignal
  1779.                 local association
  1780.                 local waitseconds
  1781.                
  1782.                 local function SwitchExits(boolean)
  1783.                     if not system then return end
  1784.                     system.Exit.Selected = boolean
  1785.                     system.Back.Selected = boolean
  1786.                 end
  1787.                
  1788.                 local function VisibleExits(boolean)
  1789.                     if not system then return end
  1790.                     system.Exit.Visible = boolean
  1791.                     system.Back.Visible = boolean
  1792.                 end
  1793.                
  1794.                 local SystemWindowFunctions = {
  1795.                     Main = function(SystemWindowFunctions,sys)
  1796.                         local signal = utility.CreateSignal()
  1797.                         local gui = box.Main:Clone()
  1798.                         local vc = gui.ViewCreations
  1799.                        
  1800.                         closeSignal = signal
  1801.                         association = gui
  1802.                         waitseconds = .2
  1803.                        
  1804.                         signal:connect(function()
  1805.                             SwitchExits(false)
  1806.                             for _,w in pairs(gui:GetChildren()) do
  1807.                                 w.Active = false
  1808.                                 w:TweenSizeAndPosition(UDim2.new(0,0,0,0),UDim2.new(w.Position.X.Scale + w.Size.X.Scale/2,0, w.Position.Y.Scale + w.Size.Y.Scale/2,0),"Out","Linear",.2,true,function() w:remove() end)
  1809.                             end
  1810.                             wait(.2)
  1811.                             gui:remove()
  1812.                             SwitchExits(true)
  1813.                             system.Back.Visible = true
  1814.                         end)
  1815.                        
  1816.                         vc.MouseButton1Click:connect(function() signal:fire() SystemWindowFunctions.SaveLoad(SystemWindowFunctions,sys) end)
  1817.                        
  1818.                         gui.Parent = sys
  1819.                         system.Back.Visible = false
  1820.                         for _,w in pairs(gui:GetChildren()) do
  1821.                             w.Active = false
  1822.                             local size,pos = w.Size, w.Position
  1823.                            
  1824.                             w.Size = UDim2.new(0,0,0,0)
  1825.                             w.Position = UDim2.new(.5,0,.5,0)
  1826.                             w:TweenSizeAndPosition(size,pos,"Out","Linear",.2,true)
  1827.                         end
  1828.                     end;
  1829.                    
  1830.                     SaveLoad = function(SystemWindowFunctions,sys)
  1831.                         local signal = utility.CreateSignal()
  1832.                         local gui = box.SaveLoad:Clone()
  1833.                         local scroll,sizeC,posC = gui.SLFrame.Scroll, gui.SLFrame.Scroll.Size, gui.SLFrame.Scroll.Position
  1834.                         local buy,buypos = gui.BuySlots, gui.BuySlots.Position
  1835.                        
  1836.                         closeSignal = signal
  1837.                         association = gui
  1838.                         waitseconds = .2
  1839.                         SaveSlots = FreeSlots + (SIService.DataPersist:InvokeServer("Load","Number","BoughtSlots") or 0)
  1840.                        
  1841.                         signal:connect(function()
  1842.                             SwitchExits(false)
  1843.                             scroll:TweenSizeAndPosition(UDim2.new(sizeC.X.Scale,0,0,0),UDim2.new(posC.X.Scale,0,posC.Y.Scale + sizeC.Y.Scale/2,0),"Out","Linear",.2,true)
  1844.                             buy:TweenPosition(UDim2.new(buypos.X.Scale,0,1,0),"Out","Linear",.2,true)
  1845.                             wait(.21)
  1846.                             gui:remove()
  1847.                             SwitchExits(true)
  1848.                         end)
  1849.                        
  1850.                         scroll.Changed:connect(function(prop)
  1851.                             if prop ~= "Size" or "Position" then return end
  1852.                             gui.SLFrame.Top.Position = scroll.Position
  1853.                             gui.SLFrame.Bottom.Position = scroll.Position + UDim2.new(0,0,scroll.Size.Y.Scale,0)
  1854.                         end)
  1855.                        
  1856.                         local function CalibratePos()
  1857.                             local offset = 0
  1858.                             for k = 1,#scroll:GetChildren() do
  1859.                                 local prev = scroll:findFirstChild(k-1)
  1860.                                 scroll[k].Position = UDim2.new(0,0,0,prev and prev.Position.Y.Offset + prev.Size.Y.Offset or 0)
  1861.                                 offset = offset + scroll[k].Size.Y.Offset
  1862.                             end
  1863.                             local canvpos = scroll.CanvasPosition
  1864.                             scroll.CanvasSize = UDim2.new(0,0,0,offset)
  1865.                         end
  1866.                        
  1867.                         for i = 1,SaveSlots do
  1868.                             local open = false
  1869.                             local file = box.File:Clone()
  1870.                             local opensize = file.Size.Y.Offset
  1871.                             file.Name = i
  1872.                             file.Slot.Text = "Slot #"..i
  1873.                             local empty = false
  1874.                            
  1875.                             local info = SIService.DataPersist:InvokeServer("Load","String","Creation"..i.."Info")
  1876.                             if info and string.len(info) > 5 then
  1877.                                 info = http:JSONDecode(info)
  1878.                                 file.SlotName.Text = info.Name
  1879.                                 file.SlotInfo.Text = info.PartQuantity.." part"..(info.PartQuantity > 1 and "s" or "").."; "..info.StorageConsumption.."% Storage Consumption (Max DCU)"
  1880.                             else
  1881.                                 file.SlotName.Text = "Empty"
  1882.                                 file.SlotInfo.Text = "0 parts; 0% Storage Consumption (Max DCU)"
  1883.                                 empty = true
  1884.                             end
  1885.                            
  1886.                             file.View.MouseButton1Click:connect(function()
  1887.                                 file.View.Active = false
  1888.                                 if not open then
  1889.                                     local act = box.Actions:Clone()
  1890.                                     if empty then act.Load.Visible = false end
  1891.                                    
  1892.                                     act.Save.MouseEnter:connect(function() file.Slot.Text = "Save Current Project as Creation" end)
  1893.                                     act.Load.MouseEnter:connect(function() file.Slot.Text = "Load Creation to Garage"          end)
  1894.                                    
  1895.                                     act.Save.MouseLeave:connect(function() file.Slot.Text = "Slot #"..i end)
  1896.                                     act.Load.MouseLeave:connect(function() file.Slot.Text = "Slot #"..i end)
  1897.                                    
  1898.                                     act.Save.MouseButton1Click:connect(function()
  1899.                                         signal:fire()
  1900.                                         SystemWindowFunctions.Save(SystemWindowFunctions,sys,i)
  1901.                                     end)
  1902.                                     act.Load.MouseButton1Click:connect(function()
  1903.                                         signal:fire()
  1904.                                         SystemWindowFunctions.Load(SystemWindowFunctions,sys,i)
  1905.                                     end)
  1906.                                    
  1907.                                     file:TweenSize(UDim2.new(1,-12,0,opensize),"Out","Quad",.15,true,function()
  1908.                                         local pos = act.Position
  1909.                                         act.Position = UDim2.new(pos.X.Scale,pos.X.Offset,1,0)
  1910.                                         act.Parent = file
  1911.                                         act:TweenPosition(pos,"Out","Quad",.15,true)
  1912.                                         open = true
  1913.                                     end)
  1914.                                 else
  1915.                                     file.Actions:TweenPosition(UDim2.new(file.Actions.Position.X.Scale,file.Actions.Position.X.Offset,1,0),"Out","Quad",.15,true,function()
  1916.                                         file.Actions:remove()
  1917.                                         file.Slot.Text = "Slot #"..i
  1918.                                         file:TweenSize(UDim2.new(1,-12,0,opensize/2),"Out","Quad",.15,true)
  1919.                                         open = false
  1920.                                     end)
  1921.                                 end
  1922.                                 wait(.3)
  1923.                                 file.View.Active = true
  1924.                             end)
  1925.                            
  1926.                             file.Size = UDim2.new(1,-12,0,opensize/2)
  1927.                             file.Changed:connect(function(prop)
  1928.                                 if prop ~= "Size" then return end
  1929.                                 CalibratePos()
  1930.                             end)
  1931.                             file.Parent = scroll
  1932.                         end
  1933.                        
  1934.                         buy.MouseButton1Click:connect(function()
  1935.                             signal:fire()
  1936.                             SystemWindowFunctions.BuySlot(SystemWindowFunctions,sys)
  1937.                         end)
  1938.                        
  1939.                         CalibratePos()
  1940.                         scroll.Size = UDim2.new(sizeC.X.Scale,0,0,0)
  1941.                         scroll.Position = UDim2.new(posC.X.Scale,0,posC.Y.Scale + sizeC.Y.Scale/2,0)
  1942.                         buy.Position = UDim2.new(buypos.X.Scale,0,1,0)
  1943.                         gui.Parent = sys
  1944.                         scroll:TweenSizeAndPosition(sizeC,posC,"Out","Linear",.2,true)
  1945.                         buy:TweenPosition(buypos,"Out","Linear",.2,true)
  1946.                         wait(.2)
  1947.                     end;
  1948.                    
  1949.                     BuySlot = function(SystemWindowFunctions,sys)
  1950.                         SwitchExits(false)
  1951.                         local signal = utility.CreateSignal()
  1952.                         local gui = SIService.PromptOrderInfo:InvokeServer(PurchaseSlotID,sys,"DevProduct")
  1953.                         SwitchExits(true)
  1954.                        
  1955.                         closeSignal = signal
  1956.                         association = gui
  1957.                         waitseconds = .2
  1958.                        
  1959.                         signal:connect(function()
  1960.                             gui:TweenSizeAndPosition(UDim2.new(gui.Size.X.Scale,0,0,0),UDim2.new(gui.Position.X.Scale,0,gui.Position.X.Scale + gui.Size.X.Scale/2,0),"Out","Linear",.21,true,function()
  1961.                                 gui:remove()
  1962.                             end)
  1963.                         end)
  1964.                        
  1965.                         gui.ProductInfo.Purchase.MouseButton1Click:connect(function()
  1966.                             gui.ProductInfo.Purchase.Visible = false
  1967.                             if SaveSlots >= MaxSaveSlots then
  1968.                                 SIService.PromptSystemWarning:FireServer("You've reached the maximum purchasable save slots.")
  1969.                                 return
  1970.                             end
  1971.                             market:PromptProductPurchase(plr,PurchaseSlotID)
  1972.                         end)
  1973.                     end;
  1974.                    
  1975.                     Save = function(SystemWindowFunctions,sys,slot)
  1976.                         local gui = box.CSL:Clone()
  1977.                         local default = gui.Cname.Text
  1978.                         local selections
  1979.                        
  1980.                         local closeSignal = nil
  1981.                         local association = nil
  1982.                         local waitseconds = 0
  1983.                        
  1984.                         gui.Parent = sys
  1985.                        
  1986.                         for _,w in pairs(SIService.FindParts:InvokeServer(_G.Team.Value)) do w.Locked = true end
  1987.                         local parts = SIService.FindParts:InvokeServer(_G.Team.Value,_G.Team.Value)
  1988.                        
  1989.                         for i = 0,#parts/20 do
  1990.                             gui.Info.Text = i*20 .. " Owned Parts Detected In Garage"
  1991.                             run.RenderStepped:wait()
  1992.                         end
  1993.                        
  1994.                         gui.Info.Text = #parts.." Owned Parts Detected In Garage"
  1995.                        
  1996.                         if #parts > SavingLimit then
  1997.                             VisibleExits(true)
  1998.                             gui.Info.Subtitle.Text = "Sorry, your creation is too big. The max is "..SavingLimit..". Try losing some parts?"
  1999.                             for _,w in pairs(SIService.FindParts:InvokeServer(_G.Team.Value)) do w.Locked = false end
  2000.                         else
  2001.                             gui.Cname.Visible = true
  2002.                             gui.SaveLoad.Visible = true
  2003.                             gui.SaveLoad.Text = "Save"
  2004.                            
  2005.                             local information = SIService.DataPersist:InvokeServer("Load","String","Creation"..slot.."Info")
  2006.                             local cname = "Empty"
  2007.                             if information and string.len(information) > 5 then cname = http:JSONDecode(information).Name end
  2008.                             if cname ~= "Empty" and cname ~= "Noname" then gui.Cname.Text = cname; gui.Cname.ClearTextOnFocus = false end
  2009.                            
  2010.                             local function SaveCreation()
  2011.                                 VisibleExits(false)
  2012.                                 gui.Cname.Visible = false
  2013.                                 gui.SaveLoad.Visible = false
  2014.                                 gui.Info.Text = ""
  2015.                                
  2016.                                 local fr = gui.LoadingBar
  2017.                                 local bar = fr.Bar
  2018.                                 local txt = fr.Action
  2019.                                
  2020.                                 local model
  2021.                                 local positioner
  2022.                                 local service
  2023.                                 local datalen
  2024.                                
  2025.                                 local actions = {
  2026.                                     ["Preparing to save..."] = function()
  2027.                                         model  = Instance.new("Model",workspace)
  2028.                                         for _,w in pairs(parts) do w.Parent = model end
  2029.                                         local block = game.ReplicatedStorage.SavePositioners["Collider".._G.Team.Value]
  2030.                                         positioner = block:Clone()
  2031.                                         positioner.Parent = model
  2032.                                         positioner.CFrame = block.CFrame
  2033.                                     end;
  2034.                                     ["Loading Compression Library..."] = function()
  2035.                                         wait(.1)
  2036.                                     end;
  2037.                                     ["Compressing and Saving Project..."] = function()
  2038.                                         datalen = SIService.SaveModel:InvokeServer(model,slot)
  2039.                                     end;
  2040.                                     ["Writing data info to slot..."] = function()
  2041.                                         SIService.DataPersist:InvokeServer("Save","String","Creation"..slot.."Info",http:JSONEncode(
  2042.                                         {
  2043.                                             Name = #parts == 0 and "Empty" or (gui.Cname.Text == default and "Noname" or (string.len(gui.Cname.Text) > 30 and string.sub(gui.Cname.Text,1,30) or gui.Cname.Text));
  2044.                                             PartQuantity = #parts;
  2045.                                             StorageConsumption = string.sub(datalen/45000,1,4);
  2046.                                         }))
  2047.                                         wait(.1)
  2048.                                     end;
  2049.                                     ["Finishing Up..."] = function()
  2050.                                         positioner:remove()
  2051.                                         for _,w in pairs(model:GetChildren()) do w.Parent = workspace end
  2052.                                         for _,w in pairs(SIService.FindParts:InvokeServer(_G.Team.Value)) do w.Locked = false end
  2053.                                         selections = SIService.SelectModel:InvokeServer(parts,BrickColor.new(1,1,1))
  2054.                                         wait(.1)
  2055.                                     end
  2056.                                 };
  2057.                                
  2058.                                 local order = {
  2059.                                     "Preparing to save...";
  2060.                                     "Loading Compression Library...";
  2061.                                     "Compressing and Saving Project...";
  2062.                                     "Writing data info to slot...";
  2063.                                     "Finishing Up...";
  2064.                                 }
  2065.                                
  2066.                                 fr.Visible = true
  2067.                                
  2068.                                 local actiondone = 0
  2069.                                 for _,w in pairs(order) do
  2070.                                     txt.Text = w
  2071.                                     actions[w]()
  2072.                                     actiondone = actiondone + 1
  2073.                                     bar:TweenSize(UDim2.new(actiondone/#order,0,1,0),"Out","Quad",.2,true)
  2074.                                 end
  2075.                                
  2076.                                 fr.Visible = false
  2077.                                 gui.Info.Text = "Save Successful"
  2078.                                 gui.Info.Subtitle.Text = "The parts highlighted in white have been saved successfully."
  2079.                                
  2080.                                 local connect1
  2081.                                 local connect2
  2082.                                
  2083.                                 local function erase()
  2084.                                     if selections then selections:remove() end
  2085.                                     connect1:disconnect()
  2086.                                     connect2:disconnect()
  2087.                                 end
  2088.                                
  2089.                                 VisibleExits(true)
  2090.                                
  2091.                                 connect1 = system.Back.MouseButton1Click:connect(erase)
  2092.                                 connect2 = system.Exit.MouseButton1Click:connect(erase)
  2093.                             end
  2094.                            
  2095.                             gui.SaveLoad.MouseButton1Click:connect(SaveCreation)
  2096.                             gui.Cname.FocusLost:connect(function(ent) if ent then SaveCreation() end end)
  2097.                         end
  2098.                     end;
  2099.                    
  2100.                     Load = function(SystemWindowFunctions,sys,slot)
  2101.                         local gui = box.CSL:Clone()
  2102.                        
  2103.                         local closeSignal = nil
  2104.                         local association = nil
  2105.                         local waitseconds = 0
  2106.                        
  2107.                        
  2108.                         local info = http:JSONDecode(SIService.DataPersist:InvokeServer("Load","String","Creation"..slot.."Info"))
  2109.                         gui.Info.Text = info.Name
  2110.                         gui.Info.Subtitle.Text = "Your current project will be removed from the game."
  2111.                         gui.SaveLoad.Visible = true
  2112.                         gui.SaveLoad.Text = "Load"
  2113.                         gui.Parent = sys
  2114.                        
  2115.                         local function LoadCreation(slot)
  2116.                             VisibleExits(false)
  2117.                             gui.SaveLoad.Visible = false
  2118.                             gui.Info.Visible = false
  2119.                            
  2120.                             local fr = gui.LoadingBar
  2121.                             local bar = fr.Bar
  2122.                             local txt = fr.Action
  2123.                            
  2124.                             local model
  2125.                             local positioner
  2126.                             local service
  2127.                             local data
  2128.                            
  2129.                             local actions = {
  2130.                                 ["Preparing to load..."] = function()
  2131.                                     removeparts(SIService.FindParts:InvokeServer(_G.Team.Value))
  2132.                                 end;
  2133.                                 ["Loading Compression Library..."] = function()
  2134.                                     wait(.1)
  2135.                                 end;
  2136.                                 ["Decoding Project..."] = function()
  2137.                                     model = SIService.LoadModel:InvokeServer(slot,game.ReplicatedStorage)
  2138.                                 end;
  2139.                                 ["Setting Project Identities..."] = function()
  2140.                                     for _,w in pairs(model:GetChildren()) do
  2141.                                         if w.Name ~= "o" then w.Name = _G.Team.Value..w.Name end
  2142.                                     end
  2143.                                 end;
  2144.                                 ["Identifying MainCoordinatorPart..."] = function()
  2145.                                     model.PrimaryPart = model.o
  2146.                                     model.o.CanCollide = false
  2147.                                 end;
  2148.                                 ["Coordinating Model..."] = function()
  2149.                                     model.Parent = workspace
  2150.                                     model:SetPrimaryPartCFrame(game.ReplicatedStorage.SavePositioners["Collider".._G.Team.Value].CFrame)
  2151.                                     model.PrimaryPart:remove()
  2152.                                     wait(.1)
  2153.                                 end;
  2154.                                 ["Finishing Up..."] = function()
  2155.                                     model:MakeJoints()
  2156.                                     spawn(function() SIService.PerformCSMethod:InvokeServer("ManipulateParts",model,{
  2157.                                         Parent = workspace;
  2158.                                         Anchored = false;
  2159.                                         Locked = false;
  2160.                                     })end)
  2161.                                 end
  2162.                             };
  2163.                            
  2164.                             local order = {
  2165.                                 "Preparing to load...";
  2166.                                 "Loading Compression Library...";
  2167.                                 "Decoding Project...";
  2168.                                 "Setting Project Identities...";
  2169.                                 "Identifying MainCoordinatorPart...";
  2170.                                 "Coordinating Model...";
  2171.                                 "Finishing Up...";
  2172.                             }
  2173.                            
  2174.                             fr.Visible = true
  2175.                            
  2176.                             local actiondone = 0
  2177.                             local stopwatch = tick()
  2178.                             for _,w in pairs(order) do
  2179.                                 txt.Text = w
  2180.                                 actions[w]()
  2181.                                 actiondone = actiondone + 1
  2182.                                 bar:TweenSize(UDim2.new(actiondone/#order,0,1,0),"Out","Quad",.2,true)
  2183.                             end
  2184.                            
  2185.                             fr.Visible = false
  2186.                             gui.Info.Visible = true
  2187.                             gui.Info.Text = "Load Successful"
  2188.                             local timetaken = tick() - stopwatch - .3
  2189.                             local wh,fr = math.modf(timetaken)
  2190.                             if string.len(fr) > 5 then timetaken = string.sub(timetaken,1,string.len(wh) + 4) end
  2191.                             gui.Info.Subtitle.Text = "Loading time: "..timetaken.."s. Send feedback to UndefinedMind regarding saving/loading issues."
  2192.                             VisibleExits(true)
  2193.                         end
  2194.                        
  2195.                         gui.SaveLoad.MouseButton1Click:connect(function() LoadCreation(slot) end)
  2196.                     end
  2197.                 }
  2198.                
  2199.                 local function LaunchSaveSystem()
  2200.                     for _,w in pairs(interface:GetChildren()) do w.Visible = false end
  2201.                     local sys = box.SaveInterface:Clone()
  2202.                     system = sys
  2203.                     sys.BackgroundTransparency = 1
  2204.                    
  2205.                     function down(child) child[child:IsA("TextButton") and "BackgroundTransparency" or "ImageColor3"] = (child:IsA("TextButton") and .9 or Color3.new(.5,.5,.5)) end
  2206.                     function up(child)   child[child:IsA("TextButton") and "BackgroundTransparency" or "ImageColor3"] = (child:IsA("TextButton") and  1 or Color3.new( 1, 1, 1)) end
  2207.                    
  2208.                     sys.DescendantAdded:connect(function(child)
  2209.                         if child:IsA("GuiButton") then
  2210.                             child.AutoButtonColor = false
  2211.                             child.MouseEnter:connect(      function() down(child) end); child.MouseLeave:connect(    function() up(child)                 end)
  2212.                             child.MouseButton1Down:connect(function() down(child) end); child.MouseButton1Up:connect(function() up(child) clicksfx:Play() end)
  2213.                         end
  2214.                     end)
  2215.                    
  2216.                     local function findparent(window)
  2217.                         for _,w in pairs(Hierarchy) do if _ == window.Name then return w end end
  2218.                     end
  2219.                    
  2220.                     sys.Back.MouseEnter:connect(      function() down(sys.Back) end); sys.Back.MouseLeave:connect(    function() up(sys.Back)                 end)
  2221.                     sys.Back.MouseButton1Down:connect(function() down(sys.Back) end); sys.Back.MouseButton1Up:connect(function() up(sys.Back) clicksfx:Play() end)
  2222.                    
  2223.                     sys.Exit.MouseEnter:connect(      function() down(sys.Back) end); sys.Exit.MouseLeave:connect(    function() up(sys.Back)                 end)
  2224.                     sys.Exit.MouseButton1Down:connect(function() down(sys.Back) end); sys.Exit.MouseButton1Up:connect(function() up(sys.Back) clicksfx:Play() end)
  2225.                    
  2226.                     local backDB = false
  2227.                     local exitDB = false
  2228.                    
  2229.                     sys.Back.MouseButton1Click:connect(function()
  2230.                         if backDB or not sys.Back.Selected then return end
  2231.                         backDB = true
  2232.                        
  2233.                         local window = sys.Window:GetChildren()[1]
  2234.                         local before = findparent(window)
  2235.                         if closeSignal and window == association then closeSignal:fire() wait(waitseconds or 0) else window:remove() end
  2236.                         waitseconds = nil
  2237.                         SystemWindowFunctions[before](SystemWindowFunctions,sys.Window)
  2238.                        
  2239.                         backDB = false
  2240.                     end)
  2241.                    
  2242.                     sys.Exit.MouseButton1Click:connect(function()
  2243.                         if exitDB or not sys.Exit.Selected then return end
  2244.                         exitDB = true
  2245.                        
  2246.                         local window = sys.Window:GetChildren()[1]
  2247.                         local before = findparent(window)
  2248.                         if before then
  2249.                             if closeSignal and window == association then closeSignal:fire() wait(waitseconds or 0) else window:remove() end
  2250.                         else
  2251.                             window:remove()
  2252.                         end
  2253.                         for i = .25,1,.05 do
  2254.                             sys.BackgroundTransparency = i
  2255.                             run.RenderStepped:wait()
  2256.                         end
  2257.                         sys:remove()
  2258.                         system = nil
  2259.                         for _,w in pairs(interface:GetChildren()) do w.Visible = true end
  2260.                     end)
  2261.                    
  2262.                     sys.Parent = interface
  2263.                     for i = 1,.25,-.05 do
  2264.                         sys.BackgroundTransparency = i
  2265.                         run.RenderStepped:wait()
  2266.                     end
  2267.                     SystemWindowFunctions.Main(SystemWindowFunctions,sys.Window)
  2268.                 end
  2269.                
  2270.                 button.MouseButton1Click:connect(LaunchSaveSystem)
  2271.             end
  2272.         }
  2273.        
  2274.         local descriptions = {GarageControls = "Garage Controls", TrustSystem = "Launch Trust/Block System", Notifications = "Notifications", SaveSystem = "Launch Save System"}
  2275.        
  2276.         for _,v in pairs(gui.Bar:GetChildren()) do
  2277.             if buttonfunctions[v.Name] then buttonfunctions[v.Name](v) end
  2278.             if v:findFirstChild("ButtonImg") then
  2279.                 v.MouseEnter:connect(function()
  2280.                     if v.ButtonImg.ImageColor3 == Color3.new(0,0,0) then return end
  2281.                     hoversfx:Play()
  2282.                     v.ButtonImg:TweenSizeAndPosition(UDim2.new(1,0,1,0),UDim2.new(0,0,0,0),"Out","Quad",.2,true)
  2283.                     if descriptions[v.Name] then gui.NameOfButton.Text = descriptions[v.Name] gui.NameOfButton.Visible = true end
  2284.                 end)
  2285.                 v.MouseLeave:connect(function()
  2286.                     if v.ButtonImg.ImageColor3 == Color3.new(0,0,0) then return end
  2287.                     v.ButtonImg:TweenSizeAndPosition(UDim2.new(1,-20,1,-20),UDim2.new(0,10,0,10),"Out","Quad",.2,true)
  2288.                     gui.NameOfButton.Visible = false
  2289.                 end)
  2290.             end
  2291.         end
  2292.     end;
  2293.    
  2294.     InstanceTracker = function(gui)
  2295.         local TweenVersion = 1
  2296.         local TVUDim = {UDim2.new(.1,0,.95,0),UDim2.new(.1,0,.75,0),UDim2.new(.1,0,.5,0)}
  2297.         local int = gui.Interface
  2298.         local info = int.Information
  2299.         local section = int.Section
  2300.         local count = int.Count
  2301.         local dtotal = int.DisplayedTotal
  2302.         local garage = int.Garage
  2303.         local perc = int.Percent
  2304.         local world = int.World
  2305.         local igt = int.InformationGatheringTime
  2306.        
  2307.         local function UpdateTracker()
  2308.             local starttime = tick()
  2309.            
  2310.             local teamfilter = section.Client.GradientBlocks.Visible == false and _G.Team.Value or false
  2311.             local garagefilter = garage.GradientBlocks.Visible == true and _G.Team.Value or false
  2312.             local unitinst = count.GradientBlocks.Visible == true and true or false
  2313.             local locate = SIService.FindParts
  2314.            
  2315.             local Counts = {
  2316.                 ["Parts"] =
  2317.                     #locate:InvokeServer(teamfilter,garagefilter,"Parts") +
  2318.                     #locate:InvokeServer(teamfilter,garagefilter,"Wedges") +
  2319.                     #locate:InvokeServer(teamfilter,garagefilter,"CornerWedges") +
  2320.                     #locate:InvokeServer(teamfilter,garagefilter,"Truss") +
  2321.                     #locate:InvokeServer(teamfilter,garagefilter,"Cylinders") +
  2322.                     #locate:InvokeServer(teamfilter,garagefilter,"Spheres") +
  2323.                     #locate:InvokeServer(teamfilter,garagefilter,"Wheels");
  2324.                 ["Body Movers"] =
  2325.                     #locate:InvokeServer(teamfilter,garagefilter,"Followers") +
  2326.                     #locate:InvokeServer(teamfilter,garagefilter,"Hovers") +
  2327.                     #locate:InvokeServer(teamfilter,garagefilter,"Stablizers") +
  2328.                     #locate:InvokeServer(teamfilter,garagefilter,"Thrusters");
  2329.                 ["Dynamic Lighting"] =
  2330.                     #locate:InvokeServer(teamfilter,garagefilter,"Lights");
  2331.                 ["Bumpers"] =
  2332.                     #locate:InvokeServer(teamfilter,garagefilter,"Bumpers");
  2333.                 ["Seats"] =
  2334.                     #locate:InvokeServer(teamfilter,garagefilter,"Vehicle Seats") +
  2335.                     #locate:InvokeServer(teamfilter,garagefilter,"Passenger Seats");
  2336.                 ["Weapons"] =
  2337.                     #locate:InvokeServer(teamfilter,garagefilter,"Weapons")
  2338.             }
  2339.            
  2340.             local total = Counts["Parts"] + Counts["Body Movers"] + Counts["Dynamic Lighting"] + Counts["Bumpers"] + Counts["Seats"] + Counts["Weapons"]
  2341.             local svalues = {Counts["Parts"]; Counts["Body Movers"]; Counts["Dynamic Lighting"]; Counts["Bumpers"]; Counts["Seats"]; Counts["Weapons"]}
  2342.             table.sort(svalues)
  2343.            
  2344.             for i = 6,1,-1 do
  2345.                 local namespace
  2346.                 local value = svalues[i]
  2347.                 for k,w in pairs(Counts) do
  2348.                     if w == value then namespace = k Counts[k] = nil break end
  2349.                 end
  2350.                 local button = info[namespace]
  2351.                 button.Position = UDim2.new(0,0,(6 - i)/6,0)
  2352.                 button.Units.Text = unitinst and value.." Inst." or ( total == 0 and "0%" or string.sub(value/total*100,1,4).."%")
  2353.             end
  2354.            
  2355.             dtotal.Text = teamfilter and total.."/"..SavingLimit or total
  2356.             if total > SavingLimit and teamfilter then
  2357.                 dtotal.TextColor3 = ConvertColor3(Color3.new(255,85,127))
  2358.             else
  2359.                 dtotal.TextColor3 = Color3.new(1,1,1)
  2360.             end
  2361.            
  2362.             igt.Text = "IGT = "..tick() - starttime.."s"
  2363.         end
  2364.        
  2365.         count.MouseButton1Click:connect(function()
  2366.             if count.GradientBlocks.Visible then return end
  2367.             clicksfx:Play()
  2368.             count.GradientBlocks.Visible = true
  2369.             perc.GradientBlocks.Visible = false
  2370.             UpdateTracker()
  2371.         end)
  2372.         perc.MouseButton1Click:connect(function()
  2373.             if perc.GradientBlocks.Visible then return end
  2374.             clicksfx:Play()
  2375.             perc.GradientBlocks.Visible = true
  2376.             count.GradientBlocks.Visible = false
  2377.             UpdateTracker()
  2378.         end)
  2379.        
  2380.         section.Client.MouseButton1Click:connect(function()
  2381.             if not section.Client.GradientBlocks.Visible then return end
  2382.             clicksfx:Play()
  2383.             section.Client.GradientBlocks.Visible = false
  2384.             section["All Clients"].GradientBlocks.Visible = true
  2385.             UpdateTracker()
  2386.         end)
  2387.         section["All Clients"].MouseButton1Click:connect(function()
  2388.             if not section["All Clients"].GradientBlocks.Visible then return end
  2389.             clicksfx:Play()
  2390.             section["All Clients"].GradientBlocks.Visible = false
  2391.             section.Client.GradientBlocks.Visible = true
  2392.             UpdateTracker()
  2393.         end)
  2394.        
  2395.         garage.MouseButton1Click:connect(function()
  2396.             if garage.GradientBlocks.Visible then return end
  2397.             clicksfx:Play()
  2398.             garage.GradientBlocks.Visible = true
  2399.             world.GradientBlocks.Visible = false
  2400.             UpdateTracker()
  2401.         end)
  2402.         world.MouseButton1Click:connect(function()
  2403.             if world.GradientBlocks.Visible then return end
  2404.             clicksfx:Play()
  2405.             world.GradientBlocks.Visible = true
  2406.             garage.GradientBlocks.Visible = false
  2407.             UpdateTracker()
  2408.         end)
  2409.        
  2410.         dtotal.MouseButton1Click:connect(function()
  2411.             TweenVersion = TweenVersion == 3 and 1 or TweenVersion + 1
  2412.             int:TweenPosition(TVUDim[TweenVersion],"Out","Linear",.3,true)
  2413.             clicksfx:Play()
  2414.         end)
  2415.        
  2416.         spawn(function()
  2417.             while wait(.5) do
  2418.                 UpdateTracker()
  2419.             end
  2420.         end)
  2421.     end;
  2422.    
  2423.     Tools = function(gui)
  2424.         local tools = gui.Toolbar
  2425.         local window = gui.Window
  2426.         local connections = {}
  2427.         local gui3ds = {}
  2428.        
  2429.         local Dragger = Instance.new("Dragger")
  2430.         local SB = Instance.new("SelectionBox",plr.PlayerGui)
  2431.         local DeleteSB = Instance.new("SelectionBox",workspace)
  2432.         local DeleteLasso = Instance.new("SelectionPartLasso",workspace)
  2433.         DeleteSB.Color = BrickColor.new("Really red")
  2434.         DeleteLasso.Color = BrickColor.new("Really red")
  2435.        
  2436.         local materialSelected = createDropUp(
  2437.             window.General.Window.Composition.Edit.Material.DropUpBox.Click,
  2438.             window.General.Window.Composition.Edit.Material.DropUpBox.Option,
  2439.             window.General.Window.Composition.Edit.Material.DropUpBox.Box.DropUp,
  2440.             Enum.Material:GetEnumItems()
  2441.         )
  2442.        
  2443.         local surfaceSelected = createDropUp(
  2444.             window.General.Window.Surface.DropUpBox.Click,
  2445.             window.General.Window.Surface.DropUpBox.Option,
  2446.             window.General.Window.Surface.DropUpBox.Box.DropUp,
  2447.             Enum.SurfaceType:GetEnumItems()
  2448.         )
  2449.        
  2450.         local ptypeSelected = createDropUp(
  2451.             window.General.Window["Create Part"].DropUpBox.Click,
  2452.             window.General.Window["Create Part"].DropUpBox.Option,
  2453.             window.General.Window["Create Part"].DropUpBox.Box.DropUp,
  2454.             plr.PlayerGui.Parts:GetChildren()
  2455.         )
  2456.        
  2457.         plr.CharacterAdded:connect(function(chr)
  2458.             DeleteLasso.Humanoid = chr:WaitForChild("Humanoid")
  2459.         end)
  2460.        
  2461.         local function createLinkedLasso(parent)
  2462.             local lasso = Instance.new("SelectionPartLasso",parent)
  2463.             lasso.Humanoid = plr.Character:findFirstChild("Humanoid")
  2464.             plr.CharacterAdded:connect(function(chr) lasso.Humanoid = plr.Character:WaitForChild("Humanoid") end)
  2465.             return lasso
  2466.         end
  2467.        
  2468.         local function ClearAllConnections()
  2469.             for _,w in pairs(connections) do connections:disconnect() connections[_] = nil end
  2470.         end
  2471.        
  2472.         local function ClearAll3dGuis()
  2473.             for _,w in pairs(gui3ds) do w:remove() gui3ds[_] = nil end
  2474.         end
  2475.        
  2476.         local function Permission(part)
  2477.             if string.sub(part.Name,1,1) == tostring(_G.Team.Value) then
  2478.                 return true
  2479.             else
  2480.                 return SIService.GetPermissions:InvokeServer(SIService.GetPlayerFromGarage:InvokeServer(string.sub(part.Name,1,1)),true).enablebuildingtools
  2481.             end
  2482.         end
  2483.        
  2484.         local function viewmsg(txt,msg,returnto,lifetime)
  2485.             spawn(function()
  2486.                 txt.Text = msg
  2487.                 wait(lifetime or 2)
  2488.                 txt.Text = returnto
  2489.             end)
  2490.         end
  2491.        
  2492.         spawn(function()
  2493.             DeleteLasso.Humanoid = plr.Character and plr.Character:WaitForChild("Humanoid") or plr.CharacterAdded:wait():WaitForChild("Humanoid")
  2494.             for i = 1,1050 do
  2495.                 BrickColors[BrickColor.new(i).Name] = BrickColor.new(i)
  2496.             end
  2497.            
  2498.             local iteration = 0
  2499.             for _,w in pairs(BrickColors) do
  2500.                 iteration = iteration + 1
  2501.                 local representation = window.General.Window.Paint.Color.Color:Clone()
  2502.                 representation.BackgroundColor3 = Color3.new(w.Color)
  2503.                 representation.Name = w.Name
  2504.                 representation.Position = UDim2.new(iteration%5 ~= 0 and iteration%5/5 -.2 or .8,1,math.floor(iteration/5)*.1,1)
  2505.                 representation.Parent = window.General.Window.Paint.Color.BrickColors
  2506.                 representation.Visible = true
  2507.             end
  2508.             window.General.Window.Paint.Color.Color:remove()
  2509.         end)
  2510.        
  2511.         local generalconnections = {}
  2512.         local general3dguis = {}
  2513.         local functions = {
  2514.             General = {
  2515.                 equip = function()
  2516.                     local con = window.General
  2517.                     con.Visible = true
  2518.                    
  2519.                     function VerifyPart(part)
  2520.                         if not part then return end
  2521.                         if part.Locked then return end
  2522.                         if not Permission(part) then return end
  2523.                         return true
  2524.                     end
  2525.                    
  2526.                     local functions = {
  2527.                         Paint = {
  2528.                             equip = function(ui)
  2529.                                 colorisout = ui.Change.Text == "Close"
  2530.                                 generalconnections.pme = ui.Change.MouseEnter:connect(function() ui.Change.BackgroundTransparency = .9 end)
  2531.                                 generalconnections.pml = ui.Change.MouseLeave:connect(function() ui.Change.BackgroundTransparency =  1 end)
  2532.                                 generalconnections.pmc = ui.Change.MouseButton1Click:connect(function()
  2533.                                     colorisout = not colorisout
  2534.                                     ui.Color.ScrollingEnabled = not colorisout
  2535.                                     ui.Color:TweenSize(UDim2.new(1,0,colorisout and 0 or -5,0),"Out","Quad",.2,true)
  2536.                                     ui.Change.Text = colorisout and "Close" or "Change"
  2537.                                     ui.Change.BackgroundTransparency = 1
  2538.                                 end)
  2539.                                
  2540.                                 local paintSB = Instance.new("SelectionBox",workspace)
  2541.                                 local paintlasso = createLinkedLasso(workspace)
  2542.                                
  2543.                                 paintSB.Color = BrickColor.new(ui.PickedColor.TextColor3)
  2544.                                 paintlasso.Color = BrickColor.new(ui.PickedColor.TextColor3)
  2545.                                
  2546.                                 table.insert(general3dguis,paintSB)
  2547.                                 table.insert(general3dguis,paintlasso)
  2548.                                
  2549.                                 local previoustarget
  2550.                                 generalconnections.ptc = mouse.Move:connect(function()
  2551.                                     if previoustarget == mouse.Target then return end
  2552.                                     previoustarget = mouse.Target
  2553.                                     if not VerifyPart(mouse.Target) then paintSB.Adornee = nil paintlasso.Part = nil return end
  2554.                                     paintSB.Adornee = mouse.Target
  2555.                                     paintlasso.Part = mouse.Target
  2556.                                 end)
  2557.                                
  2558.                                 generalconnections.pmu = mouse.Button1Up:connect(function()
  2559.                                     if not paintSB.Adornee then return end
  2560.                                     paintSB.Adornee.BrickColor = paintSB.Color
  2561.                                 end)
  2562.                                
  2563.                                 for _,w in pairs(ui.Color.BrickColors:GetChildren()) do
  2564.                                     generalconnections[w.Name.."pmc"] = w.MouseButton1Click:connect(function()
  2565.                                         paintSB.Color = BrickColor.new(w.BackgroundColor3)
  2566.                                         paintlasso.Color = BrickColor.new(w.BackgroundColor3)
  2567.                                         ui.PickedColor.Text = w.Name
  2568.                                         ui.PickedColor.TextColor3 = w.BackgroundColor3
  2569.                                     end)
  2570.                                 end
  2571.                             end;
  2572.                            
  2573.                             unequip = function(ui) end
  2574.                         };
  2575.                        
  2576.                         Composition = {
  2577.                             equip = function(ui)
  2578.                                 local frame = ui.Notice.Warning
  2579.                                 Global.Compositiondefault = "Click on a part to edit it's composition."
  2580.                                
  2581.                                 local function warnPlayer()
  2582.                                     ui.Notice.Text = ""
  2583.                                     frame.Position = UDim2.new(0,0,1,0)
  2584.                                     frame.Visible = true
  2585.                                     frame:TweenPosition(UDim2.new(0,0,.6,0),"Out","Quad",.2,true)
  2586.                                 end
  2587.                                
  2588.                                 local compSB = Instance.new("SelectionBox",workspace)
  2589.                                 local complasso = createLinkedLasso(workspace)
  2590.                                
  2591.                                 compSB.Color = BrickColor.White()
  2592.                                 complasso.Color = BrickColor.White()
  2593.                                
  2594.                                 table.insert(general3dguis,compSB)
  2595.                                 table.insert(general3dguis,complasso)
  2596.                                
  2597.                                 local previoustarget
  2598.                                 generalconnections.ctc = mouse.Move:connect(function()
  2599.                                     if mouse.Target == previoustarget then return end
  2600.                                     previoustarget = mouse.Target
  2601.                                     if not VerifyPart(mouse.Target) then compSB.Adornee = nil complasso.Part = nil return end
  2602.                                     compSB.Adornee = mouse.Target
  2603.                                     complasso.Part = mouse.Target
  2604.                                 end)
  2605.                                
  2606.                                 generalconnections.cmu = mouse.Button1Up:connect(function()
  2607.                                     if Global.ccr then Global.ccr:disconnect() Global.ccr = nil end
  2608.                                     if Global.cct then Global.cct:disconnect() Global.cct = nil end
  2609.                                     if Global.ccm then Global.ccm:disconnect() Global.ccm = nil end
  2610.                                     frame.Position = UDim2.new(0,0,1,0)
  2611.                                     frame.Visible = false
  2612.                                     ui.Notice.Text = Global.Compositiondefault
  2613.                                     ui.Edit.Visible = false
  2614.                                     ui.Notice.Text = Global.Compositiondefault
  2615.                                     if not compSB.Adornee then return end
  2616.                                     local part = compSB.Adornee
  2617.                                     if string.sub(part.Name,2,2) == ("F" or "H" or "S" or "X" or "Y" or "Z" or "W") then warnPlayer() return end
  2618.                                     local escr = ui.Edit
  2619.                                     escr.Material.DropUpBox.Box.Text = part.Material.Name
  2620.                                     escr.Reflect.Reflectance.Text = part.Reflectance
  2621.                                     escr.Trans.Trans.Text = part.Transparency
  2622.                                    
  2623.                                     Global.ccr = createC2Scale(escr.Reflect.Left,escr.Reflect.Right,0,1,.05,part.Reflectance):connect(function(value)
  2624.                                         part.Reflectance = value
  2625.                                         escr.Reflect.Reflectance.Text = value
  2626.                                     end)
  2627.                                    
  2628.                                     Global.cct = createC2Scale(escr.Trans.Left,escr.Trans.Right,string.sub(part.Name,2,2) ~= "L" and 0 or .2,.75,.05,part.Transparency):connect(function(value)
  2629.                                         part.Transparency = value
  2630.                                         escr.Trans.Trans.Text = value
  2631.                                     end)
  2632.                                    
  2633.                                     Global.ccm = materialSelected:connect(function(material)
  2634.                                         part.Material = material
  2635.                                         escr.Material.DropUpBox.Box.Text = material
  2636.                                     end)
  2637.                                     ui.Notice.Text = ""
  2638.                                     ui.Edit.Visible = true
  2639.                                 end)
  2640.                             end;
  2641.                            
  2642.                             unequip = function(ui)
  2643.                                 local frame = ui.Notice.Warning
  2644.                                
  2645.                                 if Global.ccr then Global.ccr:disconnect() Global.ccr = nil end
  2646.                                 if Global.cct then Global.cct:disconnect() Global.cct = nil end
  2647.                                 if Global.ccm then Global.ccm:disconnect() Global.ccm = nil end
  2648.                                
  2649.                                 frame.Position = UDim2.new(0,0,1,0)
  2650.                                 frame.Visible = false
  2651.                                 ui.Notice.Text = Global.Compositiondefault
  2652.                                 ui.Edit.Visible = false
  2653.                             end
  2654.                         };
  2655.                        
  2656.                         Surface = {
  2657.                             equip = function(ui)
  2658.                                
  2659.                                 local surfSS = Instance.new("SurfaceSelection",workspace)
  2660.                                 local surflasso = createLinkedLasso(workspace)
  2661.                                
  2662.                                 surfSS.Color = BrickColor.White()
  2663.                                 surflasso.Color = BrickColor.White()
  2664.                                
  2665.                                 table.insert(general3dguis,surfSS)
  2666.                                 table.insert(general3dguis,surflasso)
  2667.                                
  2668.                                 generalconnections.scs = surfaceSelected:connect(function(surface)
  2669.                                     ui.DropUpBox.Box.Text = surface
  2670.                                 end)
  2671.                                
  2672.                                 local previoustarget = mouse.Target
  2673.                                 local previoussurface = mouse.TargetSurface
  2674.                                
  2675.                                 generalconnections.stc = mouse.Move:connect(function(prop)
  2676.                                     if previoustarget == mouse.Target and previoussurface == mouse.TargetSurface then return end
  2677.                                     previoustarget = mouse.Target
  2678.                                     previoussurface = mouse.TargetSurface
  2679.                                     if not VerifyPart(mouse.Target) then surfSS.Adornee = nil surflasso.Part = nil return end
  2680.                                     surfSS.Adornee = mouse.Target
  2681.                                     surfSS.TargetSurface = mouse.TargetSurface
  2682.                                     surflasso.Part = mouse.Target
  2683.                                 end)
  2684.                                
  2685.                                 generalconnections.smu = mouse.Button1Up:connect(function()
  2686.                                     if not surfSS.Adornee then return end
  2687.                                     surfSS.Adornee[surfSS.TargetSurface.Name.."Surface"] = ui.DropUpBox.Box.Text
  2688.                                 end)
  2689.                             end;
  2690.                            
  2691.                             unequip = function(ui)end
  2692.                         };
  2693.                        
  2694.                         ["Create Part"] = {
  2695.                             equip = function(ui)
  2696.                                 generalconnections.zct = ptypeSelected:connect(function(parttype)
  2697.                                     ui.DropUpBox.Box.Text = parttype
  2698.                                 end)
  2699.                                
  2700.                                 generalconnections.zmd = mouse.Button1Down:connect(function()
  2701.                                     pcall(function() Dragger:MouseUp() end)
  2702.                                    
  2703.                                     local target = plr.PlayerGui.Parts[ui.DropUpBox.Box.Text]:GetChildren()[1]:Clone()
  2704.                                     target.Name = _G.Team.Value..target.Name
  2705.                                     target.Anchored = false
  2706.                                     target.Parent = workspace
  2707.                                     target.Position = Vector3.new(math.floor(mouse.Hit.x),math.floor(mouse.Hit.y),math.floor(mouse.Hit.z))
  2708.                                    
  2709.                                     SB.Adornee = target
  2710.                                     pcall(function() Dragger:MouseDown(target,Vector3.new(0,0,0),{target}) end)
  2711.                                    
  2712.                                     generalconnections.zku = mouse.KeyUp:connect(function(key)
  2713.                                         if key:lower() == "t" then
  2714.                                             target.CFrame = target.CFrame * CFrame.Angles(math.rad(90),0,0)
  2715.                                         elseif key:lower() == "r" then
  2716.                                             target.CFrame = target.CFrame * CFrame.Angles(0,math.rad(90),0)
  2717.                                         end
  2718.                                     end)                       
  2719.                                    
  2720.                                     generalconnections.zmm = mouse.Move:connect(function()
  2721.                                         mouse.Icon = "rbxasset://textures\\GrabRotateCursor.png"
  2722.                                         pcall(function() Dragger:MouseMove(mouse.UnitRay) end)
  2723.                                     end)
  2724.                                    
  2725.                                     generalconnections.zcu = mouse.Button1Up:connect(function()
  2726.                                         generalconnections.zcu:disconnect()
  2727.                                         generalconnections.zmm:disconnect()
  2728.                                         generalconnections.zku:disconnect()
  2729.                                         SB.Adornee = nil
  2730.                                         pcall(function() Dragger:MouseUp() end)
  2731.                                         mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
  2732.                                     end)
  2733.                                 end)
  2734.                             end;
  2735.                            
  2736.                             unequip = function(ui)
  2737.                                 SB.Adornee = nil
  2738.                                 pcall(function() Dragger:MouseUp() end)
  2739.                                 mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
  2740.                             end
  2741.                         };
  2742.                        
  2743.                         Resize = {
  2744.                             equip = function(ui)
  2745.                                 local previousDistance
  2746.                                 local handlesoverride = false
  2747.                                 local defaultmsg = "Click on a part to resize it."
  2748.                                
  2749.                                 local resSB = Instance.new("SelectionBox",plr.PlayerGui)
  2750.                                 local reslasso = createLinkedLasso(workspace)
  2751.                                 local reshandles = Instance.new("Handles",plr.PlayerGui)
  2752.                                
  2753.                                 reshandles.Color = BrickColor.Blue()
  2754.                                
  2755.                                 table.insert(general3dguis,resSB)
  2756.                                 table.insert(general3dguis,reslasso)
  2757.                                 table.insert(general3dguis,reshandles)
  2758.                                
  2759.                                 generalconnections.rmu = mouse.Button1Up:connect(function()
  2760.                                     if handlesoverride then handlesoverride = false return end
  2761.                                     resSB.Adornee = nil
  2762.                                     reslasso.Part = nil
  2763.                                     reshandles.Adornee = nil
  2764.                                     ui.Edit.Visible = false
  2765.                                     if generalconnections.watchsize then generalconnections.watchsize:disconnect() end
  2766.                                    
  2767.                                     if not mouse.Target or not mouse.Target:IsA("BasePart") then return end
  2768.                                     if mouse.Target.Locked then viewmsg(ui,"This part is locked.",defaultmsg) return end
  2769.                                     if not Permission(mouse.Target) then viewmsg(ui,"You are not trusted to have permission to resize this part.",defaultmsg) return end
  2770.                                    
  2771.                                     local target = mouse.Target
  2772.                                    
  2773.                                     resSB.Adornee = target
  2774.                                     reslasso.Part = target
  2775.                                     reshandles.Adornee = target
  2776.                                     reshandles.Faces = target.ResizeableFaces
  2777.                                    
  2778.                                     ui.Edit.X.Value.Text = target.Size.X
  2779.                                     ui.Edit.Y.Value.Text = target.Size.Y
  2780.                                     ui.Edit.Z.Value.Text = target.Size.Z
  2781.                                     ui.Edit.Visible = true
  2782.                                    
  2783.                                     generalconnections.watchsize = target.Changed:connect(function(prop)
  2784.                                         if prop ~= "Size" then return end
  2785.                                         ui.Edit.X.Value.Text = target.Size.X
  2786.                                         ui.Edit.Y.Value.Text = target.Size.Y
  2787.                                         ui.Edit.Z.Value.Text = target.Size.Z
  2788.                                     end)
  2789.                                    
  2790.                                 end)
  2791.                                
  2792.                                 generalconnections.rmd = reshandles.MouseDrag:connect(function(normal,distance)
  2793.                                     if reshandles.Adornee then
  2794.                                         local delta = distance - previousDistance
  2795.                                         if math.abs(delta) >= reshandles.Adornee.ResizeIncrement then
  2796.                                             local sizeDelta = math.floor(delta / reshandles.Adornee.ResizeIncrement + 0.5) * reshandles.Adornee.ResizeIncrement
  2797.                                             if normal.Name == ("Top" or "Bottom") then
  2798.                                                 if reshandles.Adornee.Size.Y + sizeDelta > PartLimits.MaxSize then return end
  2799.                                             elseif normal.Name == ("Left" or "Right") then
  2800.                                                 if reshandles.Adornee.Size.X + sizeDelta > PartLimits.MaxSize then return end
  2801.                                             elseif normal.Name == ("Back" or "Front") then
  2802.                                                 if reshandles.Adornee.Size.Z + sizeDelta > PartLimits.MaxSize then return end
  2803.                                             end
  2804.                                             if reshandles.Adornee:Resize(normal,sizeDelta) then
  2805.                                                 previousDistance = distance
  2806.                                             end
  2807.                                         end
  2808.                                     end
  2809.                                 end)
  2810.                                
  2811.                                 generalconnections.rbd = reshandles.MouseButton1Down:connect(function() previousDistance = 0 handlesoverride = true end)
  2812.                                 generalconnections.rbu = reshandles.MouseButton1Up:connect(function() wait(.1) handlesoverride = false end)
  2813.                             end;
  2814.                            
  2815.                             unequip = function(ui)
  2816.                                 ui.Edit.Visible = false
  2817.                             end
  2818.                         }
  2819.                     }
  2820.                    
  2821.                     local function emptyConnections()
  2822.                         for _,w in pairs(generalconnections) do w:disconnect() end
  2823.                         generalconnections = {}
  2824.                     end
  2825.                    
  2826.                     local function empty3Dguis()
  2827.                         for _,w in pairs(general3dguis) do w:remove() end
  2828.                         general3dguis = {}
  2829.                     end
  2830.                    
  2831.                     local function unequipAll()
  2832.                         for _,w in pairs(con.Parts:GetChildren()) do
  2833.                             if w.BackgroundTransparency ~= 1 then
  2834.                                 functions[w.Name].unequip(con.Window[w.Name])
  2835.                                 con.Window[w.Name].Visible = false
  2836.                                 w.BackgroundTransparency = 1
  2837.                             end
  2838.                             emptyConnections()
  2839.                             empty3Dguis()
  2840.                         end
  2841.                     end
  2842.                    
  2843.                     local function returnEquipped()
  2844.                         for _,w in pairs(con.Parts:GetChildren()) do
  2845.                             if w.BackgroundTransparency ~= 1 then return w.Name end
  2846.                         end
  2847.                     end
  2848.                    
  2849.                     for _,w in pairs(con.Parts:GetChildren()) do
  2850.                         local function linkEvents()
  2851.                             if returnEquipped() == w.Name then
  2852.                                 functions[w.Name].unequip(con.Window[w.Name])
  2853.                                 con.Window[w.Name].Visible = false
  2854.                                 w.BackgroundTransparency = 1
  2855.                                 emptyConnections()
  2856.                                 empty3Dguis()
  2857.                                 return
  2858.                             end
  2859.                             if returnEquipped() then unequipAll() end
  2860.                            
  2861.                             w.BackgroundTransparency = .8
  2862.                             con.Desc.Text = w.Name
  2863.                             con.Desc.Visible = true
  2864.                             con.Window[w.Name].Visible = true
  2865.                             functions[w.Name].equip(con.Window[w.Name])
  2866.                         end
  2867.                        
  2868.                         connections["general"..w.Name.."mouseEnterLink"] = w[w.Name].MouseEnter:connect(function()
  2869.                             if returnEquipped() then return end
  2870.                             con.Desc.Text = w.Name
  2871.                             con.Desc.Visible = true
  2872.                         end)
  2873.                        
  2874.                         connections["general"..w.Name.."mouseLeaveLink"] = w[w.Name].MouseLeave:connect(function()
  2875.                             if returnEquipped() then return end
  2876.                             con.Desc.Visible = false
  2877.                         end)
  2878.                        
  2879.                         connections["general"..w.Name.."Link"] = w[w.Name].MouseButton1Click:connect(linkEvents)
  2880.                         connections["general"..w.Name.."KeyboardLink"] = mouse.KeyUp:connect(function(key)
  2881.                             if key:upper() == w.Hotkey.Text then linkEvents() end
  2882.                         end)
  2883.                     end
  2884.                    
  2885.                     if returnEquipped() then
  2886.                         functions[returnEquipped()].equip(con.Window[returnEquipped()])
  2887.                     end
  2888.                 end;
  2889.                
  2890.                 unequip = function()
  2891.                     for _,w in pairs(generalconnections) do w:disconnect() end
  2892.                     for _,w in pairs(general3dguis) do w:remove() end
  2893.                     generalconnections = {}
  2894.                     general3dguis = {}
  2895.                 end
  2896.             };
  2897.             Copy = {
  2898.                 equip = function()
  2899.                     local txt = window.Copy
  2900.                     txt.Visible = true
  2901.                     local defaultmsg = "Click on a part to clone it. Click on a part and hold to clone and drag it."
  2902.                    
  2903.                     connections.clonedown = mouse.Button1Down:connect(function()
  2904.                         if not mouse.Target or not mouse.Target:IsA("BasePart") then return end
  2905.                         if mouse.Target.Locked then viewmsg(txt,"This part is locked.",defaultmsg) return end
  2906.                         if not Permission(mouse.Target) then viewmsg(txt,"You are not trusted to have permission to clone this part.",defaultmsg) return end
  2907.                        
  2908.                         local C = mouse.Target
  2909.                         local target = C:Clone()
  2910.                         target.Parent = workspace
  2911.                         target.Position = C.Position + Vector3.new(0,0.005,0)
  2912.                         target:MakeJoints()
  2913.                        
  2914.                         SB.Adornee = target
  2915.                         pcall(function() Dragger:MouseDown(target,Vector3.new(0,0,0),{target}) end)
  2916.                        
  2917.                         connections.clonekeyup = mouse.KeyUp:connect(function(key)
  2918.                             if key:lower() == "t" then
  2919.                                 target.CFrame = target.CFrame * CFrame.Angles(math.rad(90),0,0)
  2920.                             elseif key:lower() == "r" then
  2921.                                 target.CFrame = target.CFrame * CFrame.Angles(0,math.rad(90),0)
  2922.                             end
  2923.                         end)                       
  2924.                        
  2925.                         connections.clonemousemove = mouse.Move:connect(function()
  2926.                             mouse.Icon = "rbxasset://textures\\GrabRotateCursor.png"
  2927.                             pcall(function() Dragger:MouseMove(mouse.UnitRay) end)
  2928.                         end)
  2929.                        
  2930.                         connections.cloneup = mouse.Button1Up:connect(function()
  2931.                             connections.cloneup:disconnect()
  2932.                             connections.clonemousemove:disconnect()
  2933.                             connections.clonekeyup:disconnect()
  2934.                             SB.Adornee = nil
  2935.                             pcall(function() Dragger:MouseUp() end)
  2936.                             mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
  2937.                         end)
  2938.                     end)
  2939.                 end;
  2940.                
  2941.                 unequip = function()
  2942.                     SB.Adornee = nil
  2943.                     pcall(function() Dragger:MouseUp() end)
  2944.                     mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
  2945.                 end
  2946.             };
  2947.             Delete = {
  2948.                 equip = function()
  2949.                     local txt = window.Delete
  2950.                     txt.Visible = true
  2951.                     local defaultmsg = "Click on a part to delete it."
  2952.                     local previoustarget
  2953.                    
  2954.                     connections.deletesbplacement = mouse.Move:connect(function()
  2955.                         if previoustarget == mouse.Target then return end
  2956.                         previoustarget = mouse.Target
  2957.                         if mouse.Target and mouse.Target:IsA("BasePart") and not mouse.Target.Locked and Permission(mouse.Target) then
  2958.                             DeleteSB.Adornee = mouse.Target
  2959.                             DeleteLasso.Part = mouse.Target
  2960.                         else
  2961.                             DeleteSB.Adornee = nil
  2962.                             DeleteLasso.Part = nil
  2963.                         end
  2964.                     end)
  2965.                    
  2966.                     connections.deleteup = mouse.Button1Up:connect(function()
  2967.                         if DeleteSB.Adornee then
  2968.                             DeleteSB.Adornee:remove()
  2969.                             DeleteSB.Adornee = nil
  2970.                             DeleteLasso.Part = nil
  2971.                         end
  2972.                     end)
  2973.                 end;
  2974.                 unequip = function()
  2975.                     DeleteSB.Adornee = nil
  2976.                     DeleteLasso.Part = nil
  2977.                 end
  2978.             };
  2979.             Move = {
  2980.                 equip = function()
  2981.                     local txt = window.Move
  2982.                     txt.Visible = true
  2983.                     local defaultmsg = "Click and hold on a part to move it."
  2984.                    
  2985.                     connections.movedown = mouse.Button1Down:connect(function()
  2986.                         if not mouse.Target or not mouse.Target:IsA("BasePart") then return end
  2987.                         if mouse.Target.Locked then viewmsg(txt,"This part is locked.",defaultmsg) return end
  2988.                         if not Permission(mouse.Target) then viewmsg(txt,"You are not trusted to have permission to move this part.",defaultmsg) return end
  2989.                        
  2990.                         local target = mouse.Target
  2991.                         SB.Adornee = target
  2992.                         pcall(function() Dragger:MouseDown(target,Vector3.new(0,0,0),{target}) end)
  2993.                        
  2994.                         connections.movekeyup = mouse.KeyUp:connect(function(key)
  2995.                             if key:lower() == "t" then
  2996.                                 target.CFrame = target.CFrame * CFrame.Angles(math.rad(90),0,0)
  2997.                             elseif key:lower() == "r" then
  2998.                                 target.CFrame = target.CFrame * CFrame.Angles(0,math.rad(90),0)
  2999.                             end
  3000.                         end)                       
  3001.                        
  3002.                         connections.movemousemove = mouse.Move:connect(function()
  3003.                             mouse.Icon = "rbxasset://textures\\GrabRotateCursor.png"
  3004.                             pcall(function() Dragger:MouseMove(mouse.UnitRay) end)
  3005.                         end)
  3006.                        
  3007.                         connections.moveup = mouse.Button1Up:connect(function()
  3008.                             connections.moveup:disconnect()
  3009.                             connections.movemousemove:disconnect()
  3010.                             connections.movekeyup:disconnect()
  3011.                             SB.Adornee = nil
  3012.                             pcall(function() Dragger:MouseUp() end)
  3013.                             mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
  3014.                         end)
  3015.                     end)
  3016.                 end;
  3017.                
  3018.                 unequip = function()
  3019.                     SB.Adornee = nil
  3020.                     pcall(function() Dragger:MouseUp() end)
  3021.                     mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
  3022.                 end
  3023.             };
  3024.         }
  3025.        
  3026.         local function emptyConnections()
  3027.             for _,w in pairs(connections) do w:disconnect() end
  3028.             connections = {}
  3029.         end
  3030.                    
  3031.         local function empty3Dguis()
  3032.             for _,w in pairs(gui3ds) do w:remove() end
  3033.             gui3ds = {}
  3034.         end
  3035.                    
  3036.         local function unequipAll()
  3037.             for _,w in pairs(tools:GetChildren()) do
  3038.                 if w.BackgroundTransparency ~= 1 then
  3039.                     functions[w.Name].unequip(gui.Window[w.Name])
  3040.                     window[w.Name].Visible = false
  3041.                     w.BackgroundTransparency = 1
  3042.                 end
  3043.                 emptyConnections()
  3044.                 empty3Dguis()
  3045.             end
  3046.         end
  3047.                    
  3048.         local function returnEquipped()
  3049.             for _,w in pairs(tools:GetChildren()) do
  3050.                 if w.BackgroundTransparency ~= 1 then return w.Name end
  3051.             end
  3052.         end
  3053.                    
  3054.                    
  3055.         for _,w in pairs(tools:GetChildren()) do
  3056.             local function linkEvents()
  3057.                 if returnEquipped() == w.Name then
  3058.                     functions[w.Name].unequip(window[w.Name])
  3059.                     window[w.Name].Visible = false
  3060.                     w.BackgroundTransparency = 1
  3061.                     emptyConnections()
  3062.                     empty3Dguis()
  3063.                     return
  3064.                 end
  3065.                 if returnEquipped() then unequipAll() end
  3066.                            
  3067.                 w.BackgroundTransparency = .9
  3068.                 functions[w.Name].equip(window[w.Name])
  3069.             end
  3070.            
  3071.             w[w.Name].MouseButton1Click:connect(linkEvents)
  3072.             mouse.KeyUp:connect(function(key)
  3073.                 if key:upper() == w.Hotkey.Text then linkEvents() end
  3074.             end)
  3075.         end
  3076.     end;
  3077. }
  3078.  
  3079. for _,w in pairs(interface:GetChildren()) do
  3080.     if InterfaceFunctions[w.Name] then InterfaceFunctions[w.Name](w) end
  3081. end
  3082.  
  3083. interface.Parent = plr.PlayerGui
  3084. game.StarterGui:SetCoreGuiEnabled("Backpack",false)
  3085.  
  3086. spawn(function()
  3087.     local function CheckPhysicsFPS()
  3088.         local indexSuc, indexErr = pcall(function() workspace.GetRealPhysicsFPS() end)
  3089.         if indexErr:match("GetRealPhysicsFPS") then
  3090.             local suc, err = pcall(function()
  3091.                 if workspace:GetRealPhysicsFPS() > PhysicsFPSLimit then
  3092.                     plr:Kick()
  3093.                 end
  3094.             end)
  3095.             if not suc then
  3096.                 plr:Kick()
  3097.             end
  3098.         else
  3099.             plr:Kick()
  3100.         end
  3101.     end
  3102.    
  3103.     while wait(1) do
  3104.         CheckPhysicsFPS()
  3105.     end
  3106. end)
  3107.  
  3108. for _,ids in pairs(GamepassIDs) do
  3109.     if SIService.HasPass:InvokeServer(ids) then FreeSlots = FreeSlots + 1 end
  3110. end
  3111.  
  3112. SaveSlots = FreeSlots + (SIService.DataPersist:InvokeServer("Load","Number","BoughtSlots") or 0)
  3113.  
  3114. local WipedId = SIService.DataPersist:InvokeServer("Load","Number","SaveWipe")
  3115. if WipedId ~= SaveWipe then
  3116.     for i = 1,SaveSlots do
  3117.         SIService.DataPersist:InvokeServer("Save","String","Creation"..i,"")
  3118.         SIService.DataPersist:InvokeServer("Save","String","Creation"..i.."Info","")
  3119.     end
  3120.     SIService.DataPersist:InvokeServer("Save","Number","SaveWipe",SaveWipe)
  3121.    
  3122.     if WipedId and WipedId > 0 then SIService.PromptSystemWarning:FireServer("Your saves have been wiped.") end
  3123. end
  3124.  
  3125. spawn(function()
  3126.     local loading = plr.PlayerGui.Other.Loading
  3127.     loading.description.Text = "Preparing to load game content URLs..."
  3128.     local cp = game:GetService("ContentProvider")
  3129.     local Content = {
  3130.         {name = "WeaponMeshId", url = "http://www.roblox.com/asset/?id=1033714"};
  3131.         {name = "BumperTexture", url = "rbxassetid://150281996"};
  3132.         {name = "PartLockImg", url = "rbxassetid://179760594"};
  3133.         {name = "PartUnlockImg", url = "rbxassetid://179760592"};
  3134.     }
  3135.    
  3136.     function findContent(scope)
  3137.         for _,w in pairs(scope:GetChildren()) do
  3138.             if w:IsA("ImageLabel" or "ImageButton") then
  3139.                 table.insert(Content,{name = w.Name, url = w.Image})
  3140.             elseif w:IsA("Sound") then
  3141.                 table.insert(Content,{name = w.Name, url = w.SoundId})
  3142.                 run.RenderStepped:wait()
  3143.             end
  3144.             findContent(w)
  3145.         end
  3146.     end
  3147.    
  3148.     loading.Visible = true
  3149.    
  3150.     findContent(plr)
  3151.     findContent(game.ReplicatedStorage)
  3152.     findContent(workspace)
  3153.    
  3154.     for _,w in pairs(Content) do
  3155.         loading.description.Text = "Loading "..w.name.." ["..w.url.."]"
  3156.         cp:Preload(w.url)
  3157.         repeat wait() until cp.RequestQueueSize == 0
  3158.         loading.Bar:TweenSize(UDim2.new(_/#Content,0,1,0),"Out","Quad",.2,true)
  3159.     end
  3160.    
  3161.     loading.description.Text = "Game Content Loaded."
  3162.     loading:TweenPosition(UDim2.new(0,0,0,-25),"Out","Quad",1,true,function() loading:remove() end)
  3163. end)
  3164.  
  3165. local ClientSidedNotes = [[
  3166.     Reminders:
  3167.    
  3168.     Security Measures are needed
  3169.     Don't forget the fancy loading options
  3170.     Remeber to finish the trust system and garage controls
  3171.     Trust system Reset All Permissions button is unscripted
  3172.     Don't forget to give the interface another makeover
  3173.    
  3174.     Updates:
  3175.    
  3176.     Interface remastered in under 2 hours
  3177.     Cy-Browser Sizing Bugs are squashed
  3178.     Added the instance tracker, its basically an
  3179.     extremely advanced and decorated part counter
  3180.     Part functionality
  3181.    
  3182. ]]
  3183. print [[
  3184.     Code Ran Successfully
  3185.     Coded by TochiWasHere or UndefinedMind
  3186.     printing Update Information to Client...
  3187.    
  3188.     Client Database Code Information Last Updated: 5:53 AM EST, 11/24/14
  3189.     (c) Missing Studios
  3190.    
  3191.     printing Client-sided notes...
  3192.    
  3193. ]]
  3194.  
  3195. print(ClientSidedNotes)
Add Comment
Please, Sign In to add comment