Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --StaySpy do not play with this code. (c)Missing Studios
- local PhysicsFPSLimit = 70
- local SavingLimit = 3750
- local SaveWipe = 3
- local SaveSlots = 0
- local FreeSlots = 2
- local MaxSaveSlots = 6
- local PurchaseSlotID = 21612943
- local GamepassIDs = { 128667687; 128667735; 128667803; 128667851 }
- local BrickColors = {}
- local Global = {}
- local PartLimits = {
- MaximumThrustOutput = -10000;
- MaximumHoverAltitude = 149;
- AltitudeStartingPoint = 27;
- GyroD = 500;
- GyroP = 3000;
- PositionD = 1250;
- PositionP = 10000;
- MaxSize = 130;
- }
- local OverusedColors = {
- red = Color3.new(255/255,85/255,127/255);
- green = Color3.new(0/255,255/255,127/255);
- }
- local plr = game.Players.LocalPlayer
- local mouse = plr:GetMouse()
- local SIService = game.ReplicatedStorage.ObtainCSIInstances:InvokeServer()
- local run = game:GetService("RunService")
- local utility = LoadLibrary("RbxUtility")
- local http = game:GetService("HttpService")
- local market = game:GetService("MarketplaceService")
- local sounds = plr.PlayerGui:WaitForChild("Sounds")
- local swipesfx = sounds:WaitForChild("SwipeSFX")
- local swipesfx2 = sounds:WaitForChild("SwipeSFX2")
- local clicksfx = sounds:WaitForChild("ClickSFX")
- local locksfx = sounds:WaitForChild("Lock")
- local hoversfx = sounds:WaitForChild("MouseHoverSFX")
- local notifysfx = sounds:WaitForChild("NotificationSound")
- local clicksfx2 = sounds:WaitForChild("ClickSFX2")
- _G.GetCGPermissions = function()
- local gadmin = SIService.GetPlayerFromGarage:InvokeServer(SIService.GetGarageFromPlayer:InvokeServer())
- if gadmin then return SIService.GetPermissions:InvokeServer(gadmin,true) else return {enableforcefield = false; enablebuildingtools = false; blockplayer = false;} end
- end
- _G.DivideUDim2 = function(dividend,divisor,divideoffsets)
- return UDim2.new(
- dividend.X.Scale/divisor.X.Scale,
- divideoffsets and dividend.X.Offset/divisor.X.Offset or dividend.X.Offset,
- dividend.Y.Scale/divisor.Y.Scale,
- divideoffsets and dividend.Y.Offset/divisor.Y.Offset or dividend.Y.Offset
- )
- end
- _G.LaunchWindow = function(frame)
- local DTXS = .2
- local browser = plr.PlayerGui:findFirstChild("CyberBrowser",true)
- BrowserService = {}
- function BrowserService:UpdateTabs(tabs)
- 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
- end
- if not browser then
- browser = game.ReplicatedStorage.Miscellaneous.CyberBrowser:Clone()
- local Bsize = browser.Size
- local Bpos = browser.Position
- browser.Size = UDim2.new(Bsize.X.Scale,0,0,0)
- browser.Position = UDim2.new(Bsize.X.Scale/2,0,Bsize.Y.Scale/2,0)
- local top = browser.TopSection
- local screen = browser.Screen
- local window = browser.Screen.Window
- local tabs = browser.Tabs
- local ssize = screen.Size
- local spos = screen.Position
- local tsize = tabs.Size
- local tpos = tabs.Position
- local ttsize = top.Size
- local ttpos = top.Position
- browser.DescendantAdded:connect(function(des)
- if des:IsA("GuiButton") then
- des.MouseButton1Click:connect(function()
- clicksfx2:Play()
- end)
- end
- end)
- top.ExitTab.MouseButton1Click:connect(function()
- local direction = window:GetChildren()[1].Name
- local tabpositions = tabs:GetChildren()
- local directorypos
- for _,w in pairs(tabpositions) do if w.Name == direction then directorypos = _ break end end
- local nextindex,newtab = next(tabpositions,directorypos)
- window[direction]:remove()
- tabs[direction]:remove()
- BrowserService:UpdateTabs(tabs)
- local replacement = newtab or tabs:GetChildren()[1]
- if replacement then
- replacement.Style = "RobloxRoundDropdownButton"
- script[replacement.Name].Parent = window
- top.Text = "BYC - "..replacement.Text
- else
- top.Text = "Cyber Browser"
- script:ClearAllChildren()
- tabs:ClearAllChildren()
- window:ClearAllChildren()
- browser:TweenSizeAndPosition(
- UDim2.new(
- browser.Size.X.Scale,0,0,0
- ),
- UDim2.new(
- browser.Position.X.Scale + browser.Size.X.Scale/2,
- browser.Position.X.Offset + browser.Size.X.Offset,
- browser.Position.Y.Scale + browser.Size.Y.Scale/2,
- browser.Position.Y.Offset + browser.Size.X.Offset/2
- ),
- "Out","Linear",.2,true,
- function()
- browser:Destroy()
- end
- )
- end
- end)
- top.Exit.MouseButton1Click:connect(function()
- script:ClearAllChildren()
- tabs:ClearAllChildren()
- local page = window:GetChildren()[1]
- page:TweenSizeAndPosition(UDim2.new(page.Size.X.Scale,0,0,0),UDim2.new(0,0,.5,0),"Out","Quad",.1,true,function()
- window:ClearAllChildren()
- browser:TweenSizeAndPosition(
- UDim2.new(
- browser.Size.X.Scale,0,0,0
- ),
- UDim2.new(
- browser.Position.X.Scale + browser.Size.X.Scale/2,
- browser.Position.X.Offset + browser.Size.X.Offset,
- browser.Position.Y.Scale + browser.Size.Y.Scale/2,
- browser.Position.Y.Offset + browser.Size.X.Offset/2
- ),
- "Out","Linear",.2,true,
- function()
- browser:Destroy()
- end
- )
- end)
- end)
- top.MouseEnter:connect(function()
- browser.Active = true
- browser.Draggable = true
- end)
- top.MouseLeave:connect(function()
- browser.Active = false
- browser.Draggable = false
- end)
- local listener
- local db = false
- local function UpdateBrowserSize()
- if db then return end
- db = true
- browser.Size = UDim2.new(
- (mouse.X + 9 - browser.AbsolutePosition.X)/mouse.ViewSizeX,0,
- (mouse.Y + 9 - browser.AbsolutePosition.Y)/mouse.ViewSizeY,0
- )
- db = false
- end
- browser.Resize.MouseButton1Down:connect(function()
- if listener then return end
- listener = mouse.Move:connect(UpdateBrowserSize)
- local disconnection
- local otherdisconnection
- disconnection = mouse.Button1Up:connect(function()
- disconnection:disconnect()
- otherdisconnection:disconnect()
- listener:disconnect()
- listener = nil
- end)
- otherdisconnection = browser.Resize.MouseButton1Up:connect(function()
- disconnection:disconnect()
- otherdisconnection:disconnect()
- listener:disconnect()
- listener = nil
- end)
- end)
- browser.Resize.MouseButton2Down:connect(function()
- if listener then listener:disconnect() end
- browser.Size = Bsize
- browser.Position = Bpos
- end)
- tabs.ChildAdded:connect(function(child)
- child.MouseButton1Click:connect(function()
- if window:GetChildren()[1].Name == child.Name then return end
- for _,w in pairs(tabs:GetChildren()) do if w ~= child then w.Style = "RobloxRoundDefaultButton" end end
- child.Style = "RobloxRoundDropdownButton"
- window:GetChildren()[1].Parent = script
- script[child.Text].Parent = window
- top.Text = "BYC - "..child.Text
- end)
- end)
- local tab = game.ReplicatedStorage.Miscellaneous.TabTemplate:Clone()
- tab.Style = "RobloxRoundDropdownButton"
- tab.Text = frame.Name
- tab.Name = frame.Name
- tab.Position = UDim2.new(0,0,0,0)
- tab.Size = UDim2.new(0,0,1,-1)
- tab.Parent = tabs
- top.Text = "BYC - "..tab.Text
- frame.Parent = window
- browser.Parent = plr.PlayerGui.Interface
- BrowserService:UpdateTabs(tabs)
- browser:TweenSizeAndPosition(Bsize,Bpos,"Out","Linear",.2,true)
- else
- local top = browser.TopSection
- local window = browser.Screen.Window
- local tabs = browser.Tabs
- local tab = game.ReplicatedStorage.Miscellaneous.TabTemplate:Clone()
- tab.Style = "RobloxRoundDropdownButton"
- tab.Text = frame.Name
- tab.Name = frame.Name
- tab.Position = UDim2.new(DTXS * tabs:GetChildren())
- tab.Size = UDim2.new(0,0,1,-1)
- tab.Parent = tabs
- top.Text = "BYC - "..tab.Text
- local fsize = frame.Size
- local fpos = frame.Pos
- frame.Size = UDim2.new(fsize.X.Scale,0,0,0)
- frame.Position = UDim2.new(fpos.X.Scale/2,0,.5,0)
- BrowserService:UpdateTabs(tabs)
- frame.Parent = window
- frame:TweenSizeAndPosition(fsize,fpos,"Out","Quad",.1,true)
- end
- return frame
- end
- _G.rotateModel = function(model,center,rotation)
- local parts = {}
- local function scan(parent)
- for _,obj in pairs(parent:GetChildren()) do
- if (obj:IsA("BasePart")) then
- table.insert(parts,obj)
- end
- scan(obj)
- end
- end
- scan(model)
- for _,part in pairs(parts) do
- part.CFrame = (center*rotation*(center:inverse()*part.CFrame))
- end
- end
- _G.Iterate = function(func,start)
- for _,w in pairs(start:GetChildren()) do
- func(w)
- _G.Iterate(func,w)
- end
- end
- _G.run = game:GetService("RunService")
- _G.Team = plr.PlayerGui:WaitForChild("Team")
- _G.translation = {
- ["Player Eight"] = 8,
- ["Player Seven"] = 7,
- ["Player Six"] = 6,
- ["Player Five"] = 5,
- ["Player Four"] = 4,
- ["Player Three"] = 3,
- ["Player Two"] = 2,
- ["Player One"] = 1,
- }
- for _,w in pairs(game.Teams:GetChildren()) do
- if w.TeamColor == plr.TeamColor then plr.PlayerGui.Team.Value = _G.translation[w.Name] end
- end
- function findParts(match)
- local parts = {}
- for _,w in pairs(workspace:GetChildren()) do
- if string.match(string.sub(w.Name,1,string.len(match)),match) and w:IsA("BasePart") then table.insert(parts,w) end
- end
- return parts
- end
- function removeparts(tableofparts)
- for _,w in pairs(tableofparts) do
- w:remove()
- end
- end
- function rot(gui,start,finish)
- local diff = finish - start
- for i = 0,1,.1 do
- gui.Rotation = start + (diff*i)
- wait()
- end
- gui.Rotation = finish
- end
- function UnequipStuff(dontincludeFF)
- 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
- game.StarterGui:SetCoreGuiEnabled("Backpack",false)
- end
- function ConvertColor3(color3)
- return Color3.new(color3.r/255,color3.g/255,color3.b/255)
- end
- function getlength(tab)
- local count = 0
- for _,w in pairs(tab) do count = count + 1 end
- return count
- end
- function createC2Scale(left,right,minimum,maximum,increment,start)
- local signal = utility.CreateSignal()
- local num = start
- left.MouseButton1Click:connect(function()
- if num - increment < minimum then num = minimum signal:fire(num) else num = num - increment signal:fire(num) end
- end)
- right.MouseButton1Click:connect(function()
- if num + increment > maximum then num = maximum signal:fire(num) else num = num + increment signal:fire(num) end
- end)
- return signal
- end
- function createDropUp(click,template,box,options)
- local signal = utility.CreateSignal()
- clicked = false
- for _,w in pairs(options) do
- local opt = template:Clone()
- opt.Size = UDim2.new(1,0,1/getlength(options),0)
- opt.Position = UDim2.new(0,0,#box:GetChildren()/getlength(options),0)
- opt.Text = type(w) == "userdata" and w.Name or w
- opt.Parent = box
- opt.Visible = true
- opt.MouseEnter:connect(function()
- opt.BackgroundTransparency = .9
- end)
- opt.MouseLeave:connect(function()
- opt.BackgroundTransparency = 1
- end)
- opt.MouseButton1Click:connect(function()
- clicked = false
- box.Size = UDim2.new(1,0,0,0)
- signal:fire(opt.Text)
- end)
- end
- click.MouseButton1Click:connect(function()
- if not clicked then
- clicked = true
- box.Size = UDim2.new(1,0,-getlength(options),0)
- else
- clicked = false
- box.Size = UDim2.new(1,0,0,0)
- end
- end)
- return signal
- end
- SIService.BlockPlayer.OnClientEvent:connect(function(garage,bool)
- local blockparts = game.ReplicatedStorage.LocalBlockParts
- if bool then
- local block = blockparts["Collider"..garage]:Clone()
- block.Parent = workspace.CurrentCamera
- block.CFrame = blockparts["Collider"..garage].CFrame
- block.CanCollide = true
- else
- local block = workspace.CurrentCamera:findFirstChild("Collider"..garage)
- if block then block:remove() end
- end
- end)
- game.ReplicatedStorage.GarageDetection["Garage".._G.Team.Value].ChildRemoved:connect(function(child)
- if child.Value == plr then UnequipStuff() end
- end)
- SIService.SafteyPlayer.OnClientEvent:connect(UnequipStuff)
- SIService.SetCoreGuiEnabled.OnClientEvent:connect(function(coreguitype,bool)
- game.StarterGui:SetCoreGuiEnabled(coreguitype,bool or not game.StarterGui:GetCoreGuiEnabled(coreguitype))
- end)
- local interface = game.ReplicatedStorage.Interface:Clone()
- local InterfaceFunctions = {
- Sidebar = function(interface)
- local opt = interface.Options
- local expanded = {
- ForceField = true;
- WalkSpeed = false;
- Clean = false;
- ["Stuff Lock"] = false;
- }
- local IsOut = false
- local IsOutCP = false
- opt.Position = UDim2.new(1,0,0,0)
- local guiinfo = {
- ForceField = {
- g = opt.ForceField,
- gpos = opt.ForceField.Position,
- size = opt.ForceField.Size,
- ts = opt.ForceField.TextLabel.Size,
- t = opt.ForceField.TextLabel,
- expand = UDim2.new(1,0,.075,0);
- exfunc = function(section)
- local label = section.TextLabel
- if SIService.IsInGarage:InvokeServer(_G.Team.Value) or _G.GetCGPermissions().enableforcefield then
- if plr.Character then
- local force = plr.Character:findFirstChild("ForceField")
- if force then force:remove() else Instance.new("ForceField",plr.Character) end
- else
- label.Text = "Nonexistant Character"
- wait(1)
- label.Text = "ForceField"
- end
- else
- label.Text = "No ForceField Area"
- wait(1)
- label.Text = "ForceField"
- end
- end
- };
- WalkSpeed = {
- g = opt.WalkSpeed,
- gpos = opt.WalkSpeed.Position,
- size = opt.WalkSpeed.Size,
- ts = opt.WalkSpeed.TextLabel.Size,
- t = opt.WalkSpeed.TextLabel,
- expand = UDim2.new(1,0,.225,0);
- exfunc = function(section)
- wait(.15)
- local gui = game.ReplicatedStorage.OptionsBox.WalkSpeed:Clone()
- local run = gui.Run
- local walk = gui.Walk
- local err = gui.ErrorMessage
- function GenError(message)
- run.Active = false
- run.Visible = false
- walk.Active = false
- walk.Visible = false
- err.Text = message
- err.Visible = true
- wait(1)
- err.Text = ""
- err.Visible = false
- run.Active = true
- run.Visible = true
- walk.Active = true
- walk.Visible = true
- end
- if plr.Character and plr.Character:findFirstChild("Humanoid") then
- if plr.Character.Humanoid.WalkSpeed == 30 then
- walk.Position = UDim2.new(0,0,0,0)
- run.Position = UDim2.new(1,0,0,0)
- else
- walk.Position = UDim2.new(1,0,0,0)
- run.Position = UDim2.new(0,0,0,0)
- end
- end
- run.MouseButton1Click:connect(function()
- if not plr.Character then GenError("Nonexistant Character") return end
- if plr.Character.Humanoid.Health == 0 then GenError("Dead Robloxian") return end
- run.Active = false
- walk.Active = false
- walk.Position = UDim2.new(1,0,0,0)
- swipesfx2:Play()
- run:TweenPosition(UDim2.new(-1,0,0,0),"Out","Linear",.1,true,nil)
- walk:TweenPosition(UDim2.new(0,0,0,0),"Out","Linear",.1,true,nil)
- plr.Character.Humanoid.WalkSpeed = 30
- wait(.1)
- run.Active = true
- walk.Active = true
- end)
- walk.MouseButton1Click:connect(function()
- if not plr.Character then GenError("Nonexistant Character") return end
- if plr.Character.Humanoid.Health == 0 then GenError("Dead Robloxian") return end
- run.Active = false
- walk.Active = false
- run.Position = UDim2.new(1,0,0,0)
- swipesfx2:Play()
- run:TweenPosition(UDim2.new(0,0,0,0),"Out","Linear",.1,true,nil)
- walk:TweenPosition(UDim2.new(-1,0,0,0),"Out","Linear",.1,true,nil)
- plr.Character.Humanoid.WalkSpeed = 16
- wait(.1)
- run.Active = true
- walk.Active = true
- end)
- gui.Position = UDim2.new(1,0,.4,0)
- gui.Parent = section
- gui:TweenPosition(UDim2.new(.05,0,.4,0),"Out","Quad",.15,true,nil)
- repeat wait() until not expanded.WalkSpeed
- gui:TweenPosition(UDim2.new(1,0,.4,0),"Out","Quad",.15,false,nil)
- wait(.15)
- gui:remove()
- end
- };
- Clean = {
- g = opt.Clean,
- gpos = opt.Clean.Position,
- size = opt.Clean.Size,
- ts = opt.Clean.TextLabel.Size,
- t = opt.Clean.TextLabel,
- expand = UDim2.new(1,0,.35,0);
- exfunc = function(section)
- local gui = game.ReplicatedStorage.OptionsBox.Clean:Clone()
- for _,w in pairs(gui.Other:GetChildren()) do w.MouseButton1Click:connect(function() removeparts(SIService.FindParts:InvokeServer(_G.Team.Value,nil,w.Name)) end) end
- gui["Clean All Parts"].MouseButton1Click:connect(function() removeparts(SIService.FindParts:InvokeServer(_G.Team.Value)) end)
- 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)
- for _,w in pairs(gui:GetChildren()) do w.Position = w.Position + UDim2.new(1,0,0,0) end
- gui.Parent = section
- for _,w in pairs(gui:GetChildren()) do w:TweenPosition(w.Position - UDim2.new(1,0,0,0),"Out","Quad",.3,true) wait(.15) end
- repeat wait() until not expanded.Clean
- gui:remove()
- end
- };
- ["Stuff Lock"] = {
- g = opt["Stuff Lock"],
- gpos = opt["Stuff Lock"].Position,
- size = opt["Stuff Lock"].Size,
- ts = opt["Stuff Lock"].TextLabel.Size,
- t = opt["Stuff Lock"].TextLabel,
- expand = UDim2.new(1,0,.225,0);
- exfunc = function(section)
- wait(.15)
- local lock = game.ReplicatedStorage.OptionsBox.StuffLock:Clone()
- lock.Position = UDim2.new(.25,0,1,0)
- lock.Parent = section
- lock:TweenPosition(UDim2.new(.25,0,.275,0),"Out","Quad",.5,true,nil)
- lock.MouseButton1Click:connect(function()
- lock.Active = false
- if lock.Image == "rbxassetid://179760592" then
- --locking
- for _,w in pairs(findParts(_G.Team.Value)) do
- w.Locked = true
- end
- lock.Image = "rbxassetid://179760594"
- else
- --unlocking
- for _,w in pairs(findParts(_G.Team.Value)) do
- w.Locked = false
- end
- lock.Image = "rbxassetid://179760592"
- end
- locksfx:Play()
- lock.Active = true
- end)
- repeat wait() until not expanded["Stuff Lock"]
- lock:TweenPosition(UDim2.new(.25,0,-.75,0),"Out","Quad",.15,true,nil)
- end
- };
- }
- for _,w in pairs(guiinfo) do
- w.g.Changed:connect(function(prop)
- if prop == "Size" then
- local last
- local newtab = {
- guiinfo.ForceField,
- guiinfo.WalkSpeed,
- guiinfo.Clean,
- guiinfo["Stuff Lock"],
- }
- for i,v in pairs(newtab) do
- local pos = v.g.Position
- v.g.Position = UDim2.new(pos.X.Scale,0, last and (last.g.Position.Y.Scale + last.g.Size.Y.Scale) or .1,0)
- last = v
- end
- w.t.Size = UDim2.new(1,0,w.size.Y.Scale/w.g.Size.Y.Scale,0)
- end
- end)
- w.t.MouseEnter:connect(function()
- if w.expanded then return end
- swipesfx:Play()
- w.t.Font = "Arial"
- end)
- w.t.MouseLeave:connect(function()
- if w.expanded then return end
- w.t.Font = "SourceSans"
- end)
- w.g.MouseButton1Click:connect(function()
- if not expanded[w.g.Name] or w.g.Name == "ForceField" then
- if w.exfunc then
- w.Active = false
- w.t.Font = "SourceSans"
- expanded[w.g.Name] = true
- clicksfx:Play()
- w.g:TweenSize(w.expand,"Out","Quad",.15,true,nil)
- w.exfunc(w.g)
- w.Active = true
- end
- else
- if w.exfunc then
- w.Active = false
- w.t.Font = "SourceSans"
- expanded[w.g.Name] = false
- clicksfx:Play()
- w.g:TweenSize(w.size,"Out","Quad",.15,true,nil)
- w.Active = true
- end
- end
- end)
- end
- for _,w in pairs(guiinfo) do
- w.g.Position = w.g.Position + UDim2.new(1,0,0,0)
- end
- local function openOptions()
- IsOut = true
- opt:TweenPosition(UDim2.new(0,0,0,0),"Out","Linear",.3,true,nil)
- wait(.3)
- local last
- local newtab = {
- guiinfo.ForceField,
- guiinfo.WalkSpeed,
- guiinfo.Clean,
- guiinfo["Stuff Lock"],
- }
- for i,v in pairs(newtab) do
- local pos = v.g.Position
- v.g.Position = UDim2.new(pos.X.Scale,0, last and (last.g.Position.Y.Scale + last.g.Size.Y.Scale) or .1,0)
- last = v
- end
- for _,w in pairs(guiinfo) do
- w.g:TweenPosition(w.g.Position - UDim2.new(1,0,0,0),"Out","Quad",.3,true,nil)
- wait(.15)
- end
- end
- local function closeOptions()
- IsOut = false
- for _,w in pairs(guiinfo) do
- w.g:TweenPosition(w.gpos + UDim2.new(1,0,0,0),"Out","Quad",.15,true,nil)
- wait(.075)
- end
- wait(.15)
- opt:TweenPosition(UDim2.new(1,0,0,0),"Out","Linear",.15,true,nil)
- end
- local function returnScalarPoint(slider)
- local pointChanged = utility.CreateSignal()
- slider.Draggable = false
- local listenToMouseMovement
- local disconnectMovement
- local disconnectMovementReinforce
- local disconnectMovementReinforce2
- slider.MouseButton1Down:connect(function()
- listenToMouseMovement = mouse.Move:connect(function()
- if not slider or slider.Parent == nil then return end
- local scale = (mouse.X - slider.Parent.AbsolutePosition.x - slider.AbsoluteSize.x)/(slider.Parent.AbsoluteSize.x - slider.AbsoluteSize.x)
- if scale < 0 then scale = 0 elseif scale > (1 - slider.Size.X.Scale) then scale = 1 - slider.Size.X.Scale end
- slider.Position = UDim2.new(scale,0,-.85,0)
- pointChanged:fire(slider.Position.X.Scale / ( 1 - slider.Size.X.Scale ))
- end)
- disconnectMovement = slider.MouseButton1Up:connect(function()
- listenToMouseMovement:disconnect()
- disconnectMovement:disconnect()
- disconnectMovementReinforce:disconnect()
- disconnectMovementReinforce2:disconnect()
- end)
- disconnectMovementReinforce = mouse.Button1Up:connect(function()
- listenToMouseMovement:disconnect()
- disconnectMovement:disconnect()
- disconnectMovementReinforce:disconnect()
- disconnectMovementReinforce2:disconnect()
- end)
- disconnectMovementReinforce2 = slider.Parent.Parent.MouseLeave:connect(function()
- listenToMouseMovement:disconnect()
- disconnectMovement:disconnect()
- disconnectMovementReinforce:disconnect()
- disconnectMovementReinforce2:disconnect()
- end)
- end)
- return pointChanged
- end
- local pcpConnections = {}
- local pcpSignals = {
- Hovers = utility.CreateSignal();
- Thrusters = utility.CreateSignal();
- Lights = utility.CreateSignal();
- Seats = utility.CreateSignal();
- Followers = utility.CreateSignal();
- Stablizers = utility.CreateSignal();
- }
- local pcpSettings = {
- Hovers = {
- controlBy = "All";
- obj = setmetatable({},{
- __newindex = function(obj,i,v)
- rawset(obj,i,v)
- pcpSignals.Hovers:fire(v)
- v.Changed:connect(function()
- if not v or v.Parent == nil then
- obj[i] = nil
- pcpSignals.Hovers:fire()
- end
- end)
- end
- });
- giveFunctionality = function(self,gui,cpart)
- if cpart == "All" then
- gui.Enabled.MouseButton1Click:connect(function()
- if gui.Enabled.Text == "Off" then
- gui.Enabled.Text = "On"
- gui.Enabled.BackgroundColor3 = OverusedColors.green
- for _,w in pairs(self.obj) do
- w.BodyPosition.P = PartLimits.PositionP
- w.BodyPosition.D = PartLimits.PositionD
- end
- else
- gui.Enabled.Text = "Off"
- gui.Enabled.BackgroundColor3 = OverusedColors.red
- for _,w in pairs(self.obj) do
- w.BodyPosition.P = 0
- w.BodyPosition.D = 0
- end
- end
- end)
- returnScalarPoint(gui.Altitude.Slider):connect(function(scale)
- for _,w in pairs(self.obj) do
- w.BodyPosition.position = Vector3.new(w.Position.x,PartLimits.AltitudeStartingPoint + PartLimits.MaximumHoverAltitude*scale,w.Position.z)
- end
- end)
- else
- gui.Enabled.MouseButton1Click:connect(function()
- if gui.Enabled.Text == "Off" then
- gui.Enabled.Text = "On"
- gui.Enabled.BackgroundColor3 = OverusedColors.green
- cpart.BodyPosition.P = PartLimits.PositionP
- cpart.BodyPosition.D = PartLimits.PositionD
- else
- gui.Enabled.Text = "Off"
- gui.Enabled.BackgroundColor3 = OverusedColors.red
- cpart.BodyPosition.P = 0
- cpart.BodyPosition.D = 0
- end
- end)
- returnScalarPoint(gui.Altitude.Slider):connect(function(scale)
- if not cpart or not cpart.Parent then return end
- cpart.BodyPosition.position = Vector3.new(cpart.Position.x,PartLimits.AltitudeStartingPoint + PartLimits.MaximumHoverAltitude*scale,cpart.Position.z)
- end)
- if cpart.BodyPosition.P ~= 0 and cpart.BodyPosition.D ~= 0 then
- gui.Enabled.Text = "On"
- gui.Enabled.BackgroundColor3 = OverusedColors.green
- end
- if cpart.BodyPosition.position.Y > PartLimits.AltitudeStartingPoint then
- 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)
- end
- end
- end
- };
- Thrusters = {
- controlBy = "All";
- obj = setmetatable({},{
- __newindex = function(obj,i,v)
- rawset(obj,i,v)
- pcpSignals.Thrusters:fire(v)
- v.Changed:connect(function()
- if not v or v.Parent == nil then
- obj[i] = nil
- pcpSignals.Thrusters:fire()
- end
- end)
- end
- });
- giveFunctionality = function(self,gui,cpart)
- if cpart == "All" then
- returnScalarPoint(gui["Thrust Output"].Slider):connect(function(scale)
- for _,w in pairs(self.obj) do
- w.BodyThrust.force = Vector3.new(PartLimits.MaximumThrustOutput*scale,0,0)
- if scale > 0 then w.Fire.Enabled = true w.Fire.Size = scale * 20 else w.Fire.Enabled = false end
- end
- end)
- elseif cpart == "X" then
- returnScalarPoint(gui["Thrust Output"].Slider):connect(function(scale)
- for _,w in pairs(self.obj) do
- if string.sub(w.Name,2,2) == "X" then
- w.BodyThrust.force = Vector3.new(PartLimits.MaximumThrustOutput*scale,0,0)
- if scale > 0 then w.Fire.Enabled = true w.Fire.Size = scale * 20 else w.Fire.Enabled = false end
- end
- end
- end)
- elseif cpart == "Y" then
- returnScalarPoint(gui["Thrust Output"].Slider):connect(function(scale)
- for _,w in pairs(self.obj) do
- if string.sub(w.Name,2,2) == "Y" then
- w.BodyThrust.force = Vector3.new(PartLimits.MaximumThrustOutput*scale,0,0)
- if scale > 0 then w.Fire.Enabled = true w.Fire.Size = scale * 20 else w.Fire.Enabled = false end
- end
- end
- end)
- elseif cpart == "Z" then
- returnScalarPoint(gui["Thrust Output"].Slider):connect(function(scale)
- for _,w in pairs(self.obj) do
- if string.sub(w.Name,2,2) == "Z" then
- w.BodyThrust.force = Vector3.new(PartLimits.MaximumThrustOutput*scale,0,0)
- if scale > 0 then w.Fire.Enabled = true w.Fire.Size = scale * 20 else w.Fire.Enabled = false end
- end
- end
- end)
- else
- returnScalarPoint(gui["Thrust Output"].Slider):connect(function(scale)
- if not cpart or not cpart.Parent then return end
- cpart.BodyThrust.force = Vector3.new(PartLimits.MaximumThrustOutput*scale,0,0)
- if scale > 0 then cpart.Fire.Enabled = true cpart.Fire.Size = scale * 20 else cpart.Fire.Enabled = false end
- end)
- if cpart.BodyThrust.force.X < 0 then
- gui["Thrust Output"].Slider.Position = UDim2.new(cpart.BodyThrust.force.X / PartLimits.MaximumThrustOutput - gui["Thrust Output"].Slider.Size.X.Scale,0,-.85,0)
- end
- end
- end
- };
- Lights = {
- controlBy = "All";
- obj = setmetatable({},{
- __newindex = function(obj,i,v)
- rawset(obj,i,v)
- pcpSignals.Lights:fire(v)
- v.Changed:connect(function()
- if not v or v.Parent == nil then
- obj[i] = nil
- pcpSignals.Lights:fire()
- end
- end)
- end
- });
- giveFunctionality = function(self,gui,cpart)
- if cpart == "All" then
- gui.Enabled.MouseButton1Click:connect(function()
- for _,w in pairs(self.obj) do
- w.PointLight.Enabled = not gui.Enabled.GradientBlocks.Visible
- end
- gui.Enabled.GradientBlocks.Visible = not gui.Enabled.GradientBlocks.Visible
- end)
- else
- gui.Enabled.MouseButton1Click:connect(function()
- cpart.PointLight.Enabled = not gui.Enabled.GradientBlocks.Visible
- gui.Enabled.GradientBlocks.Visible = not gui.Enabled.GradientBlocks.Visible
- end)
- if not cpart.PointLight.Enabled then
- gui.Enabled.GradientBlocks.Visible = false
- end
- end
- end
- };
- Seats = {
- controlBy = "All";
- obj = setmetatable({},{
- __newindex = function(obj,i,v)
- rawset(obj,i,v)
- pcpSignals.Seats:fire(v)
- v.Changed:connect(function()
- if not v or v.Parent == nil then
- obj[i] = nil
- pcpSignals.Seats:fire()
- end
- end)
- end
- });
- giveFunctionality = function(self,gui,cpart)
- gui.Enabled.MouseEnter:connect(function() gui.Enabled.BackgroundTransparency = .9 end)
- gui.Enabled.MouseLeave:connect(function() gui.Enabled.BackgroundTransparency = 1 end)
- gui.Enabled.MouseButton1Down:connect(function() gui.Enabled.BackgroundTransparency = .9 end)
- gui.Enabled.MouseButton1Up:connect(function() gui.Enabled.BackgroundTransparency = 1 end)
- if cpart == "All" then
- gui.Enabled.MouseButton1Click:connect(function()
- for _,w in pairs(self.obj) do
- spawn(function()
- w.Disabled = true
- wait(.5)
- w.Disabled = false
- end)
- end
- end)
- else
- gui.Enabled.MouseButton1Click:connect(function()
- cpart.Disabled = true
- wait(.5)
- cpart.Disabled = false
- end)
- end
- end
- };
- Followers = {
- controlBy = "All";
- obj = setmetatable({},{
- __newindex = function(obj,i,v)
- rawset(obj,i,v)
- pcpSignals.Followers:fire(v)
- v.Changed:connect(function()
- if not v or v.Parent == nil then
- obj[i] = nil
- pcpSignals.Followers:fire()
- end
- end)
- end
- });
- giveFunctionality = function(self,gui,cpart)
- if cpart == "All" then
- gui.Enabled.MouseButton1Click:connect(function()
- if gui.Enabled.Text == "Off" then
- gui.Enabled.Text = "On"
- gui.Enabled.BackgroundColor3 = OverusedColors.green
- for _,w in pairs(self.obj) do
- w.RocketPropulsion:Fire()
- w.Smoke.Enabled = true
- end
- else
- gui.Enabled.Text = "Off"
- gui.Enabled.BackgroundColor3 = OverusedColors.red
- for _,w in pairs(self.obj) do
- w.RocketPropulsion:Abort()
- w.Smoke.Enabled = false
- end
- end
- end)
- local trackOthers = false
- gui.FY.MouseButton1Click:connect(function()
- if gui.FY.BackgroundTransparency == .9 then return end
- trackOthers = false
- gui.FY.BackgroundTransparency = .9
- gui.FO.BackgroundTransparency = 1
- for _,w in pairs(self.obj) do
- w.RocketPropulsion.Target = plr.Character.Torso
- end
- end)
- gui.FO.MouseButton1Click:connect(function()
- if gui.FO.BackgroundTransparency == .9 then return end
- trackOthers = true
- gui.FY.BackgroundTransparency = 1
- gui.FO.BackgroundTransparency = .9
- for _,w in pairs(self.obj) do
- spawn(function()
- while w and trackOthers do
- target = SIService.GetClosestPlayer:InvokeServer(w.Position)
- if target and target.Character:findFirstChild("Torso") then w.RocketPropulsion.Target = target.Character.Torso end
- wait(.5)
- end
- end)
- end
- end)
- else
- gui.Enabled.MouseButton1Click:connect(function()
- if gui.Enabled.Text == "Off" then
- gui.Enabled.Text = "On"
- gui.Enabled.BackgroundColor3 = OverusedColors.green
- cpart.RocketPropulsion:Fire()
- cpart.Smoke.Enabled = true
- else
- gui.Enabled.Text = "Off"
- gui.Enabled.BackgroundColor3 = OverusedColors.red
- cpart.RocketPropulsion:Abort()
- cpart.Smoke.Enabled = false
- end
- end)
- local trackOthers = false
- gui.FY.MouseButton1Click:connect(function()
- if gui.FY.BackgroundTransparency == .9 then return end
- trackOthers = false
- gui.FY.BackgroundTransparency = .9
- gui.FO.BackgroundTransparency = 1
- cpart.RocketPropulsion.Target = plr.Character.Torso
- end)
- gui.FO.MouseButton1Click:connect(function()
- if gui.FO.BackgroundTransparency == .9 then return end
- trackOthers = true
- gui.FY.BackgroundTransparency = 1
- gui.FO.BackgroundTransparency = .9
- cpart.RocketPropulsion.Target = nil
- spawn(function()
- while cpart and trackOthers do
- target = SIService.GetClosestPlayer:InvokeServer(cpart.Position)
- if target and target.Character:findFirstChild("Torso") then cpart.RocketPropulsion.Target = target.Character.Torso end
- wait(.5)
- end
- end)
- end)
- if cpart.Smoke.Enabled then
- gui.Enabled.Text = "On"
- gui.Enabled.BackgroundColor3 = OverusedColors.green
- end
- if cpart.RocketPropulsion.Target then
- if plr.Character:findFirstChild("Torso") and cpart.RocketPropulsion.Target == plr.Character.Torso then
- gui.FY.BackgroundTransparency = .9
- elseif game.Players:GetPlayerFromCharacter(cpart.RocketPropulsion.Target.Parent) then
- gui.FO.BackgroundTransparency = .9
- end
- end
- end
- end
- };
- Stablizers = {
- controlBy = "All";
- obj = setmetatable({},{
- __newindex = function(obj,i,v)
- rawset(obj,i,v)
- pcpSignals.Stablizers:fire(v)
- v.Changed:connect(function()
- if not v or v.Parent == nil then
- obj[i] = nil
- pcpSignals.Stablizers:fire()
- end
- end)
- end
- });
- giveFunctionality = function(self,gui,cpart)
- if cpart == "All" then
- gui.Enabled.MouseButton1Click:connect(function()
- for _,w in pairs(self.obj) do
- if gui.Enabled.GradientBlocks.Visible then
- w.BodyGyro.D = 0
- w.BodyGyro.P = 0
- w.SelectionBox.Transparency = 1
- else
- w.BodyGyro.D = PartLimits.GyroD
- w.BodyGyro.P = PartLimits.GyroP
- w.SelectionBox.Transparency = 0
- end
- end
- gui.Enabled.GradientBlocks.Visible = not gui.Enabled.GradientBlocks.Visible
- end)
- else
- gui.Enabled.MouseButton1Click:connect(function()
- if gui.Enabled.GradientBlocks.Visible then
- cpart.BodyGyro.D = 0
- cpart.BodyGyro.P = 0
- cpart.SelectionBox.Transparency = 1
- else
- cpart.BodyGyro.D = PartLimits.GyroD
- cpart.BodyGyro.P = PartLimits.GyroP
- cpart.SelectionBox.Transparency = 0
- end
- gui.Enabled.GradientBlocks.Visible = not gui.Enabled.GradientBlocks.Visible
- end)
- if cpart.SelectionBox.Transparency == 1 then gui.Enabled.GradientBlocks.Visible = false end
- end
- end
- };
- }
- workspace.ChildAdded:connect(function(child)
- if string.sub(child.Name,1,1) == tostring(_G.Team.Value) then
- local class = string.sub(child.Name,2,2)
- if class == "H" then
- pcpSettings.Hovers.obj[child] = child
- elseif class == "X" or class == "Y" or class == "Z" then
- pcpSettings.Thrusters.obj[child] = child
- elseif class == "L" then
- pcpSettings.Lights.obj[child] = child
- elseif class == "F" then
- pcpSettings.Followers.obj[child] = child
- elseif class == "S" then
- pcpSettings.Stablizers.obj[child] = child
- elseif child:IsA("VehicleSeat" or "Seat") then
- pcpSettings.Seats.obj[child] = child
- end
- end
- end)
- local function OpenPanel()
- local box = game.ReplicatedStorage.PCPgui
- local pcp = box.PartsControlPanel:Clone()
- pcp.Position = UDim2.new(1,0,0,0)
- local cby = pcp.Control
- local scroll = pcp.Scroller
- local allocatedspace = 1.5
- IsOutCP = true
- local function RecalculatePositions()
- local cSizeY = 0
- for index,w in pairs(scroll:GetChildren()) do
- local sizer = index ~= 1 and scroll:GetChildren()[index - 1].Size.Y.Offset or 0
- local start = index ~= 1 and scroll:GetChildren()[index - 1].Position.Y.Offset or 0
- local other = index ~= 1 and scroll:GetChildren()[index - 1].Window.Size.Y.Scale or 0
- w.Position = UDim2.new(0,0,0,start + sizer + (sizer * other))
- cSizeY = cSizeY + (w.AbsoluteSize.y + (w.AbsoluteSize.y * w.Window.Size.Y.Scale))
- end
- scroll.CanvasSize = UDim2.new(0,0,0,cSizeY)
- end
- pcp.Parent = opt.Parent
- for _,w in pairs(pcpSettings) do
- cby[_][w.controlBy].BackgroundTransparency = .9
- local gui = box.Gui:Clone()
- gui.Name = _
- gui.Text = _.."("..getlength(w.obj)..")"
- gui.Parent = scroll
- gui.Window.Changed:connect(function(prop)
- if (prop ~= "AbsoluteSize" and prop ~= "AbsolutePosition") then return end
- RecalculatePositions()
- end)
- local updateCount = pcpSignals[_]:connect(function()
- gui.Text = _.."("..getlength(w.obj)..")"
- end)
- local function UpdateControlBy()
- gui.Window.Parts:ClearAllChildren()
- if pcpConnections.CreateNewGui then
- pcpConnections.CreateNewGui:disconnect()
- pcpConnections.CreateNewGui = nil
- end
- if w.controlBy == "All" then
- local fgui = box[_]:Clone()
- fgui.NOC.Text = "All ".._
- w.giveFunctionality(w,fgui,"All")
- local reticle = {}
- fgui.MouseEnter:connect(function()
- plr.PlayerGui.Reticles:ClearAllChildren()
- local argument = {}
- for q,qq in pairs(w.obj) do
- table.insert(argument,qq)
- end
- reticle = SIService.CreateReticle:InvokeServer(argument)
- end)
- fgui.MouseLeave:connect(function()
- for _,w in pairs(reticle) do
- w:remove()
- end
- reticle = {}
- end)
- fgui.Parent = gui.Window.Parts
- gui.Window:TweenSize(UDim2.new(1,0,allocatedspace,0),"Out","Quad",.2,true)
- elseif w.controlBy == "Individual" then
- for index,part in pairs(w.obj) do
- local fgui = box[_]:Clone()
- fgui.NOC.Text = string.sub(_,1,string.len(_)-1).." "..#gui.Window.Parts:GetChildren()+1
- w.giveFunctionality(w,fgui,part)
- fgui.Size = UDim2.new(1,0,1/getlength(w.obj),0)
- fgui.Position = UDim2.new(0,0,1/getlength(w.obj)*#gui.Window.Parts:GetChildren(),0)
- local reticle
- fgui.MouseEnter:connect(function()
- plr.PlayerGui.Reticles:ClearAllChildren()
- reticle = SIService.CreateReticle:InvokeServer(part)
- end)
- fgui.MouseLeave:connect(function()
- if reticle then reticle:remove() reticle = nil end
- end)
- fgui.Parent = gui.Window.Parts
- spawn(function()
- repeat wait() until not part or part.Parent == nil
- fgui:remove()
- if not gui or not gui.Parent then return end
- for pos,PCGUI in pairs(gui.Window.Parts:GetChildren()) do
- 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)
- end
- gui.Window:TweenSize(UDim2.new(1,0,allocatedspace*getlength(w.obj),0),"Out","Quad",.2,true)
- end)
- end
- pcpConnections.CreateNewGui = pcpSignals[_]:connect(function(part)
- if not part then return end
- local fgui = box[_]:Clone()
- fgui.NOC.Text = string.sub(_,1,string.len(_)-1).." "..#gui.Window:GetChildren()+1
- w.giveFunctionality(w,fgui,part)
- fgui.Size = UDim2.new(1,0,0,0)
- fgui.Position = UDim2.new(0,0,1,0)
- local reticle
- fgui.MouseEnter:connect(function()
- plr.PlayerGui.Reticles:ClearAllChildren()
- reticle = SIService.CreateReticle:InvokeServer(part)
- end)
- fgui.MouseLeave:connect(function()
- if reticle then reticle:remove() reticle = nil end
- end)
- fgui.Parent = gui.Window.Parts
- for pos,PCGUI in pairs(gui.Window.Parts:GetChildren()) do
- 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)
- end
- gui.Window:TweenSize(UDim2.new(1,0,allocatedspace*getlength(w.obj),0),"Out","Quad",.2,true)
- end)
- gui.Window:TweenSize(UDim2.new(1,0,allocatedspace*getlength(w.obj),0),"Out","Quad",.2,true)
- elseif w.controlBy == "Section" then
- local translate = {"X","Y","Z"}
- for section = 1,3 do
- local fgui = box[_]:Clone()
- fgui.NOC.Text = "Section "..section
- w.giveFunctionality(w,fgui,translate[section])
- fgui.Size = UDim2.new(1,0,1/#translate,0)
- fgui.Position = UDim2.new(0,0,1/#translate*(section-1),0)
- local reticle = {}
- fgui.MouseEnter:connect(function()
- plr.PlayerGui.Reticles:ClearAllChildren()
- local qqq = {}
- for _,w in pairs(w.obj) do
- if string.sub(w.Name,2,2) == translate[section] then table.insert(qqq,w) end
- end
- reticle = SIService.CreateReticle:InvokeServer(qqq)
- end)
- fgui.MouseLeave:connect(function()
- for _,w in pairs(reticle) do
- w:remove()
- end
- reticle = {}
- end)
- fgui.Parent = gui.Window.Parts
- end
- gui.Window:TweenSize(UDim2.new(1,0,allocatedspace*#translate,0),"Out","Quad",.2,true)
- end
- end
- for __,x in pairs(cby[_]:GetChildren()) do
- x.MouseButton1Click:connect(function()
- if x.BackgroundTransparency == .9 then return end
- for __,y in pairs(cby[_]:GetChildren()) do
- y.BackgroundTransparency = 1
- end
- w.controlBy = x.Name
- x.BackgroundTransparency = .9
- UpdateControlBy()
- end)
- UpdateControlBy()
- end
- end
- RecalculatePositions()
- pcp:TweenPosition(UDim2.new(0,0,0,0),"Out","Quad",.3,true)
- end
- local function ClosePanel()
- IsOutCP = false
- local panel = opt.Parent:findFirstChild("PartsControlPanel")
- plr.PlayerGui.Reticles:ClearAllChildren()
- if panel then
- panel:TweenPosition(UDim2.new(1,0,0,0),"Out","Quad",.3,true,function() panel:remove() end)
- wait(.3)
- end
- end
- local function OpenInterface()
- game.StarterGui:SetCoreGuiEnabled("PlayerList",false)
- interface:TweenPosition(UDim2.new(.8,0,0,0),"Out","Quad",.2,true)
- end
- local function CloseInterface()
- game.StarterGui:SetCoreGuiEnabled("PlayerList",true)
- interface:TweenPosition(UDim2.new(1,0,0,0),"Out","Quad",.2,true)
- end
- local tasks = interface.Tasks
- local function GenNotification(message,color,box,lifetime)
- if not message or not color or not box then return end
- local note = game.ReplicatedStorage.TaskbarBox.Note:Clone()
- note.Position = UDim2.new(1,0,0,0)
- note.Text = message
- note.BackgroundColor3 = color
- note.Parent = box
- note:TweenPosition(UDim2.new(0,0,0,0),"Out","Linear",.3,true,function()
- wait(lifetime or 3)
- note:TweenPosition(UDim2.new(1,0,note.Position.Y.Scale,0),"Out","Linear",.3,true,function()
- note:remove()
- end)
- end)
- return note
- end
- local offset = 10
- local taskfunctions = {
- Options = {desc = "Options"; buttonfunction = function(button,notebox)
- if IsOutCP then ClosePanel() end
- if IsOut then closeOptions() CloseInterface() else OpenInterface() openOptions() end
- end};
- RetrieveTools = {desc = "Toggle Tools"; buttonfunction = function(button,notebox)
- 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
- game.StarterGui:SetCoreGuiEnabled("Backpack",not game.StarterGui:GetCoreGuiEnabled("Backpack"))
- end};
- ControlParts = {desc = "Part Control Panel"; buttonfunction = function(button,notebox)
- if IsOut then closeOptions() end
- if IsOutCP then ClosePanel() CloseInterface() else OpenInterface() OpenPanel() end
- end};
- }
- for _,w in pairs(tasks:GetChildren()) do
- local notebox = game.ReplicatedStorage.TaskbarBox.NotificationBox:Clone()
- local bsize = w.Size
- local bpos = w.Position
- notebox.Parent = w
- local note = game.ReplicatedStorage.TaskbarBox.Note:Clone()
- note.Position = UDim2.new(1,0,0,0)
- if taskfunctions[w.Name] then note.Text = taskfunctions[w.Name].desc end
- note.ZIndex = 10
- note.Parent = notebox
- w.MouseEnter:connect(function()
- if w.Rotation ~= 0 or note.Position == UDim2.new(0,0,0,0) then return end
- note.Visible = true
- w.Size = bsize + UDim2.new(0,offset,0,offset)
- w.Position = bpos - UDim2.new(0,offset/2,0,offset/2)
- swipesfx:Play()
- note:TweenPosition(UDim2.new(0,0,0,0),"Out","Linear",.15,true)
- end)
- w.MouseLeave:connect(function()
- w.Size = bsize
- w.Position = bpos
- note.Position = UDim2.new(1,0,0,0)
- note.Visible = false
- end)
- w.MouseButton1Click:connect(function()
- if taskfunctions[w.Name] and taskfunctions[w.Name].buttonfunction then clicksfx:Play() taskfunctions[w.Name].buttonfunction(w,notebox) end
- end)
- end
- opt.Position = UDim2.new(1,0,0,0)
- interface.Position = UDim2.new(1,0,0,0)
- end;
- QuickAccess = function(gui)
- local buttonfunctions = {
- GarageControls = function(button)
- local frame = button.GarageControls
- local framesize = frame.Size
- local door = workspace.Map.Garages.Garages["Garage".._G.Team.Value].Door
- local ceiling = door.Parent.Top
- local qfloor = door.Parent.Bottom
- local P = Vector3.new(door.Position.X,door.Position.Y - door.Size.Y/2,door.Position.Z)
- local S = door.Size
- local buttonfunctions = {
- ["Open/Close Garage"] = function(button)
- local open = false
- local rotation = CFrame.Angles(door.CFrame:toEulerAnglesXYZ())
- button.MouseButton1Click:connect(function()
- if not button.Active then return end
- clicksfx:Play()
- button.Active = false
- if not open then
- button.Text = "Opening..."
- button.BackgroundColor3 = ConvertColor3(Color3.new(0,255,127))
- open = not open
- local OS = Instance.new("Sound",door)
- OS.SoundId = "rbxassetid://142643714"
- OS.Pitch = 4
- OS.Volume = .2
- OS:Play()
- for i = 1,0,-.1 do
- button.BackgroundTransparency = i
- door.Size = Vector3.new(S.X,S.Y * i,S.Z)
- door.CFrame = CFrame.new(P.X,P.Y + door.Size.Y/2,P.Z) * rotation
- wait(.1)
- end
- button.Text = "Open/Close Garage"
- button.BackgroundColor3 = ConvertColor3(Color3.new(255,255,255))
- button.BackgroundTransparency = .9
- OS:remove()
- else
- local CS = Instance.new("Sound",door)
- CS.SoundId = "rbxassetid://142643742"
- CS.Pitch = 4
- CS.Volume = .2
- CS:Play()
- button.Text = "Closing..."
- button.BackgroundColor3 = ConvertColor3(Color3.new(255,85,127))
- open = not open
- for i = 0,1,.05 do
- button.BackgroundTransparency = 1 - i
- door.Size = Vector3.new(S.X,S.Y * (i + .05),S.Z)
- door.CFrame = CFrame.new(P.X,P.Y + door.Size.Y/2,P.Z) * rotation
- wait()
- end
- button.Text = "Open/Close Garage"
- button.BackgroundColor3 = ConvertColor3(Color3.new(255,255,255))
- button.BackgroundTransparency = .9
- CS:remove()
- end
- button.Active = true
- end)
- end;
- ["Transparent"] = function(button)
- button = button.Box
- button.MouseButton1Click:connect(function()
- button.Active = false
- if button.Text == "X" then
- button.Text = ""
- for i = .5,0,-.05 do
- door.Transparency = i
- run.RenderStepped:wait()
- end
- else
- button.Text = "X"
- for i = 0,.5,.05 do
- door.Transparency = i
- run.RenderStepped:wait()
- end
- end
- button.Active = true
- end)
- end;
- ["Retracted Back"] = function(button)
- button = button.Box
- button.MouseButton1Click:connect(function()
- button.Active = false
- if button.Text == "X" then
- button.Text = ""
- SIService.FireMotor:FireServer("Back",false)
- else
- button.Text = "X"
- SIService.FireMotor:FireServer("Back",true)
- end
- button.Active = true
- end)
- end;
- ["Ceiling Off"] = function(button)
- button = button.Box
- local pos = ceiling.Position
- local angles = CFrame.Angles(ceiling.CFrame:toEulerAnglesXYZ())
- button.MouseButton1Click:connect(function()
- button.Active = false
- local sfx = Instance.new("Sound",ceiling)
- sfx.SoundId = "rbxassetid://147627083"
- sfx.Volume = 1
- sfx:Play()
- if button.Text == "X" then
- button.Text = ""
- ceiling.CanCollide = false
- ceiling.CFrame = CFrame.new(pos + Vector3.new(0,1000,0)) * angles
- for i = 1,0,-.1 do
- ceiling.CFrame = CFrame.new(pos + Vector3.new(0,100*i,0)) * angles
- ceiling.Transparency = i
- wait()
- end
- ceiling.CanCollide = true
- else
- button.Text = "X"
- ceiling.CanCollide = false
- for i = 0,1,.1 do
- ceiling.CFrame = CFrame.new(pos + Vector3.new(0,100*i,0)) * angles
- ceiling.Transparency = i
- wait()
- end
- ceiling.CFrame = CFrame.new(1000000,1000000,1000000) * angles
- end
- sfx:remove()
- button.Active = true
- end)
- end;
- }
- for _,w in pairs(frame:GetChildren()) do
- if buttonfunctions[w.Name] then
- buttonfunctions[w.Name](w)
- end
- end
- local isout = false
- button.MouseButton1Click:connect(function()
- clicksfx:Play()
- if not isout then
- isout = not isout
- button.ButtonImg.ImageColor3 = Color3.new(0,0,0)
- for k,w in pairs(frame:GetChildren()) do
- spawn(function()
- wait(.2 + (k * .1))
- w:TweenPosition(UDim2.new(0,0,w.Position.Y.Scale,0),"Out","Quad",.1,true)
- swipesfx2:Play()
- end)
- end
- frame:TweenSize(UDim2.new(framesize.X.Scale,0,framesize.Y.Scale,0),"Out","Quad",.2,true)
- swipesfx2:Play()
- else
- isout = not isout
- button.ButtonImg.ImageColor3 = Color3.new(1,1,1)
- for k,w in pairs(frame:GetChildren()) do
- spawn(function()
- wait((.1 * #frame:GetChildren()) - k * .1)
- w:TweenPosition(UDim2.new(-1,0,w.Position.Y.Scale,0),"Out","Quad",.1,true)
- swipesfx2:Play()
- end)
- end
- wait(.1 * #frame:GetChildren() + .2)
- frame:TweenSize(UDim2.new(framesize.X.Scale,0,0,0),"Out","Quad",.2,true)
- swipesfx2:Play()
- end
- end)
- frame.Size = UDim2.new(framesize.X.Scale,0,0,0)
- for _,w in pairs(frame:GetChildren()) do
- w.Position = UDim2.new(-1,0,w.Position.Y.Scale,0)
- end
- end;
- TrustSystem = function(button)
- local currentwindow
- button.MouseButton1Click:connect(function()
- if currentwindow then return end
- button.ButtonImg.ImageColor3 = Color3.new(0,0,0)
- local manager = game.ReplicatedStorage.Miscellaneous["Trust Manager"]:Clone()
- local F11 = manager.FullScreenUI
- local pf = manager.PermissionsFrame
- local plrframe = manager.PlayerFrame
- local plrlist = plrframe.PlayerList
- local OverrideByFilter = false
- function InitializeClick(tab)
- tab.MouseButton1Click:connect(function()
- if tab.BackgroundTransparency == 0 then tab.BackgroundTransparency = 1 pf.PlayerPermissions:remove() return end
- for _,w in pairs(plrlist:GetChildren()) do
- w.BackgroundTransparency = 1
- end
- tab.BackgroundTransparency = 0
- if pf:findFirstChild("PlayerPermissions") then pf.PlayerPermissions:remove() end
- local plr = game.Players[tab.Name]
- local plrpf = game.ReplicatedStorage.Miscellaneous.PlayerPermissions:Clone()
- tab.Changed:connect(function(prop)
- if prop == "Parent" then
- if tab.Parent == nil then plrpf:remove() end
- end
- end)
- function UpdatePermissions(plr)
- 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;})
- end
- plrpf.PlayerImg.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=200&y=200&Format=Png&username="..plr.Name
- local cp = SIService.GetPermissions:InvokeServer(plr)
- local aff = plrpf.AllowForceFielding
- local ab = plrpf.AllowBuilding
- local bp = plrpf.BlockPlayer
- local stpr = plrpf.SendTPRequest
- aff.Box.Text = cp.enableforcefield and "X" or ""
- ab.Box.Text = cp.enablebuildingtools and "X" or ""
- bp.Box.Text = cp.blockplayer and "X" or ""
- aff.Box.MouseButton1Click:connect(function()
- aff.Box.Text = aff.Box.Text == "X" and "" or "X"
- UpdatePermissions(plr)
- end)
- ab.Box.MouseButton1Click:connect(function()
- ab.Box.Text = ab.Box.Text == "X" and "" or "X"
- UpdatePermissions(plr)
- end)
- bp.Box.MouseButton1Click:connect(function()
- bp.Box.Text = bp.Box.Text == "X" and "" or "X"
- UpdatePermissions(plr)
- end)
- local function Perform()
- SIService.LoadCharacter:FireServer(plr)
- end
- plrpf.SendTPRequest.Box.MouseButton1Click:connect(function()
- SIService.SendNotification:FireServer(plr,game.Players.LocalPlayer.Name.." wants you to teleport to their location.","RequestTeleport")
- end)
- plrpf.KickPlayer.Box.MouseButton1Click:connect(Perform)
- if not game.ReplicatedStorage.GarageDetection["Garage".._G.Team.Value]:findFirstChild(plr.Name) then plrpf.KickPlayer.Visible = false end
- game.ReplicatedStorage.GarageDetection["Garage".._G.Team.Value].ChildAdded:connect(function(child)
- if child.Name == plr.Name and plrpf:findFirstChild("KickPlayer") then plrpf.KickPlayer.Visible = true end
- end)
- game.ReplicatedStorage.GarageDetection["Garage".._G.Team.Value].ChildRemoved:connect(function(child)
- if child.Name == plr.Name and plrpf:findFirstChild("KickPlayer") then plrpf.KickPlayer.Visible = false end
- end)
- plrpf.OtherOptions["Reset Permissions"].MouseButton1Click:connect(function()
- aff.Box.Text = ""
- ab.Box.Text = ""
- bp.Box.Text = ""
- UpdatePermissions(plr)
- end)
- plrpf.Parent = pf
- end)
- end
- local function RefreshWP()
- plrlist:ClearAllChildren()
- for _,w in pairs(game.Players:GetPlayers()) do
- if w ~= game.Players.LocalPlayer then
- local plrtab = game.ReplicatedStorage.Miscellaneous.PlayerLabel:Clone()
- plrtab.Name = w.Name
- plrtab.Text = w.Name
- plrtab.Position = UDim2.new(-1,0,.125 * #plrlist:GetChildren(),0)
- plrtab.Parent = plrlist
- plrtab:TweenPosition(plrtab.Position + UDim2.new(1,0,0,0),"Out","Linear",.1,true)
- InitializeClick(plrtab)
- end
- end
- end
- currentwindow = _G.LaunchWindow(manager)
- RefreshWP()
- game.Players.ChildAdded:connect(function(plr)
- if not plrlist then return end
- if OverrideByFilter or not plr:IsA("Player") then return end
- local plrtab = game.ReplicatedStorage.Miscellaneous.PlayerLabel:Clone()
- plrtab.Name = plr.Name
- plrtab.Text = plr.Name
- plrtab.Position = UDim2.new(-1,0,.125 * #plrlist:GetChildren(),0)
- plrtab.Parent = plrlist
- plrtab:TweenPosition(plrtab.Position + UDim2.new(1,0,0,0),"Out","Linear",.1,true)
- InitializeClick(plrtab)
- end)
- game.Players.ChildRemoved:connect(function(plr)
- if OverrideByFilter or not plr:IsA("Player") or not plrlist then return end
- plrlist[plr.Name]:remove()
- for _,w in pairs(plrlist:GetChildren()) do
- w:TweenPosition(UDim2.new(0,0, .125 * (_ - 1),0),"Out","Linear",.1,true)
- end
- end)
- local childaddconnection
- local childremoveconnection
- plrframe.Filtering.Box.MouseButton1Click:connect(function()
- local box = plrframe.Filtering.Box
- if box.Text == "" then
- OverrideByFilter = true
- box.Text = "X"
- plrlist:ClearAllChildren()
- for _,w in pairs(game.ReplicatedStorage.GarageDetection["Garage".._G.Team.Value]:GetChildren()) do
- if w.Name ~= game.Players.LocalPlayer.Name then
- local plrtab = game.ReplicatedStorage.Miscellaneous.PlayerLabel:Clone()
- plrtab.Name = w.Name
- plrtab.Text = w.Name
- plrtab.Position = UDim2.new(-1,0,.125 * #plrlist:GetChildren(),0)
- plrtab.Parent = plrlist
- plrtab:TweenPosition(plrtab.Position + UDim2.new(1,0,0,0),"Out","Linear",.1,true)
- InitializeClick(plrtab)
- end
- end
- childaddconnection = game.ReplicatedStorage.GarageDetection["Garage".._G.Team.Value].ChildAdded:connect(function(child)
- if child.Name == game.Players.LocalPlayer.Name then return end
- local plrtab = game.ReplicatedStorage.Miscellaneous.PlayerLabel:Clone()
- plrtab.Name = child.Name
- plrtab.Text = child.Name
- plrtab.Position = UDim2.new(-1,0,.125 * #plrlist:GetChildren(),0)
- plrtab.Parent = plrlist
- plrtab:TweenPosition(plrtab.Position + UDim2.new(1,0,0,0),"Out","Linear",.1,true)
- InitializeClick(plrtab)
- end)
- childremoveconnection = game.ReplicatedStorage.GarageDetection["Garage".._G.Team.Value].ChildRemoved:connect(function(child)
- if child.Name == game.Players.LocalPlayer.Name then return end
- plrlist[child.Name]:remove()
- for _,w in pairs(plrlist:GetChildren()) do
- w:TweenPosition(UDim2.new(0,0, .125 * (#plrlist:GetChildren()-1),0),"Out","Linear",.2,true)
- end
- end)
- else
- box.Text = ""
- childaddconnection:disconnect()
- childremoveconnection:disconnect()
- RefreshWP()
- OverrideByFilter = false
- end
- end)
- repeat wait() until not currentwindow or currentwindow.Parent == nil
- currentwindow = nil
- button.ButtonImg.ImageColor3 = Color3.new(1,1,1)
- end)
- end;
- Notifications = function(button)
- local n = button.Notifications
- local nsize = n.Size
- local npos = n.Position
- local sf = n.ScrollingFrame
- local image = button.Circle
- local dys = .25
- local function Recalculate()
- local newCS = #sf:GetChildren() * .25 > 1 and #sf:GetChildren() * .25 or 1
- sf.CanvasSize = UDim2.new(0,0,newCS,0)
- for k,w in pairs(sf:GetChildren()) do
- w:TweenSizeAndPosition(UDim2.new(1,-13,dys / newCS,0),UDim2.new(0,0,dys / newCS * (k-1),0),"Out","Quad",.3,true)
- end
- image.Visible = (#sf:GetChildren() > 0 and true or false)
- image.Amount.Text = (#sf:GetChildren() < 99 and #sf:GetChildren() or "99+")
- n.None.Visible = (#sf:GetChildren() == 0 and true or false)
- end
- sf.ChildAdded:connect(Recalculate)
- sf.ChildRemoved:connect(Recalculate)
- SIService.SendNotification.OnClientEvent:connect(function(note)
- note.Size = UDim2.new(1,-13,0,0)
- note.Position = UDim2.new(0,0,dys / sf.CanvasSize.Y.Scale * #sf:GetChildren(),0)
- note.Parent = sf
- notifysfx:Play()
- end)
- Recalculate()
- n.Size = UDim2.new(nsize.X.Scale,0,0,0)
- n.Visible = false
- button.MouseButton1Click:connect(function()
- if not n.Visible then
- n.Visible = true
- n:TweenSize(nsize,"Out","Linear",.15,true)
- button.ButtonImg.ImageColor3 = Color3.new(0,0,0)
- else
- n:TweenSize(UDim2.new(nsize.X.Scale,0,0,0),"Out","Linear",.15,true,function() n.Visible = false end)
- button.ButtonImg.ImageColor3 = Color3.new(1,1,1)
- end
- end)
- end;
- SaveSystem = function(button)
- local box = game.ReplicatedStorage.SLUI
- local system
- local Hierarchy = {
- CSL = "SaveLoad";
- TransactionManager = "SaveLoad";
- SaveLoad = "Main";
- }
- local closeSignal
- local association
- local waitseconds
- local function SwitchExits(boolean)
- if not system then return end
- system.Exit.Selected = boolean
- system.Back.Selected = boolean
- end
- local function VisibleExits(boolean)
- if not system then return end
- system.Exit.Visible = boolean
- system.Back.Visible = boolean
- end
- local SystemWindowFunctions = {
- Main = function(SystemWindowFunctions,sys)
- local signal = utility.CreateSignal()
- local gui = box.Main:Clone()
- local vc = gui.ViewCreations
- closeSignal = signal
- association = gui
- waitseconds = .2
- signal:connect(function()
- SwitchExits(false)
- for _,w in pairs(gui:GetChildren()) do
- w.Active = false
- 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)
- end
- wait(.2)
- gui:remove()
- SwitchExits(true)
- system.Back.Visible = true
- end)
- vc.MouseButton1Click:connect(function() signal:fire() SystemWindowFunctions.SaveLoad(SystemWindowFunctions,sys) end)
- gui.Parent = sys
- system.Back.Visible = false
- for _,w in pairs(gui:GetChildren()) do
- w.Active = false
- local size,pos = w.Size, w.Position
- w.Size = UDim2.new(0,0,0,0)
- w.Position = UDim2.new(.5,0,.5,0)
- w:TweenSizeAndPosition(size,pos,"Out","Linear",.2,true)
- end
- end;
- SaveLoad = function(SystemWindowFunctions,sys)
- local signal = utility.CreateSignal()
- local gui = box.SaveLoad:Clone()
- local scroll,sizeC,posC = gui.SLFrame.Scroll, gui.SLFrame.Scroll.Size, gui.SLFrame.Scroll.Position
- local buy,buypos = gui.BuySlots, gui.BuySlots.Position
- closeSignal = signal
- association = gui
- waitseconds = .2
- SaveSlots = FreeSlots + (SIService.DataPersist:InvokeServer("Load","Number","BoughtSlots") or 0)
- signal:connect(function()
- SwitchExits(false)
- 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)
- buy:TweenPosition(UDim2.new(buypos.X.Scale,0,1,0),"Out","Linear",.2,true)
- wait(.21)
- gui:remove()
- SwitchExits(true)
- end)
- scroll.Changed:connect(function(prop)
- if prop ~= "Size" or "Position" then return end
- gui.SLFrame.Top.Position = scroll.Position
- gui.SLFrame.Bottom.Position = scroll.Position + UDim2.new(0,0,scroll.Size.Y.Scale,0)
- end)
- local function CalibratePos()
- local offset = 0
- for k = 1,#scroll:GetChildren() do
- local prev = scroll:findFirstChild(k-1)
- scroll[k].Position = UDim2.new(0,0,0,prev and prev.Position.Y.Offset + prev.Size.Y.Offset or 0)
- offset = offset + scroll[k].Size.Y.Offset
- end
- local canvpos = scroll.CanvasPosition
- scroll.CanvasSize = UDim2.new(0,0,0,offset)
- end
- for i = 1,SaveSlots do
- local open = false
- local file = box.File:Clone()
- local opensize = file.Size.Y.Offset
- file.Name = i
- file.Slot.Text = "Slot #"..i
- local empty = false
- local info = SIService.DataPersist:InvokeServer("Load","String","Creation"..i.."Info")
- if info and string.len(info) > 5 then
- info = http:JSONDecode(info)
- file.SlotName.Text = info.Name
- file.SlotInfo.Text = info.PartQuantity.." part"..(info.PartQuantity > 1 and "s" or "").."; "..info.StorageConsumption.."% Storage Consumption (Max DCU)"
- else
- file.SlotName.Text = "Empty"
- file.SlotInfo.Text = "0 parts; 0% Storage Consumption (Max DCU)"
- empty = true
- end
- file.View.MouseButton1Click:connect(function()
- file.View.Active = false
- if not open then
- local act = box.Actions:Clone()
- if empty then act.Load.Visible = false end
- act.Save.MouseEnter:connect(function() file.Slot.Text = "Save Current Project as Creation" end)
- act.Load.MouseEnter:connect(function() file.Slot.Text = "Load Creation to Garage" end)
- act.Save.MouseLeave:connect(function() file.Slot.Text = "Slot #"..i end)
- act.Load.MouseLeave:connect(function() file.Slot.Text = "Slot #"..i end)
- act.Save.MouseButton1Click:connect(function()
- signal:fire()
- SystemWindowFunctions.Save(SystemWindowFunctions,sys,i)
- end)
- act.Load.MouseButton1Click:connect(function()
- signal:fire()
- SystemWindowFunctions.Load(SystemWindowFunctions,sys,i)
- end)
- file:TweenSize(UDim2.new(1,-12,0,opensize),"Out","Quad",.15,true,function()
- local pos = act.Position
- act.Position = UDim2.new(pos.X.Scale,pos.X.Offset,1,0)
- act.Parent = file
- act:TweenPosition(pos,"Out","Quad",.15,true)
- open = true
- end)
- else
- file.Actions:TweenPosition(UDim2.new(file.Actions.Position.X.Scale,file.Actions.Position.X.Offset,1,0),"Out","Quad",.15,true,function()
- file.Actions:remove()
- file.Slot.Text = "Slot #"..i
- file:TweenSize(UDim2.new(1,-12,0,opensize/2),"Out","Quad",.15,true)
- open = false
- end)
- end
- wait(.3)
- file.View.Active = true
- end)
- file.Size = UDim2.new(1,-12,0,opensize/2)
- file.Changed:connect(function(prop)
- if prop ~= "Size" then return end
- CalibratePos()
- end)
- file.Parent = scroll
- end
- buy.MouseButton1Click:connect(function()
- signal:fire()
- SystemWindowFunctions.BuySlot(SystemWindowFunctions,sys)
- end)
- CalibratePos()
- scroll.Size = UDim2.new(sizeC.X.Scale,0,0,0)
- scroll.Position = UDim2.new(posC.X.Scale,0,posC.Y.Scale + sizeC.Y.Scale/2,0)
- buy.Position = UDim2.new(buypos.X.Scale,0,1,0)
- gui.Parent = sys
- scroll:TweenSizeAndPosition(sizeC,posC,"Out","Linear",.2,true)
- buy:TweenPosition(buypos,"Out","Linear",.2,true)
- wait(.2)
- end;
- BuySlot = function(SystemWindowFunctions,sys)
- SwitchExits(false)
- local signal = utility.CreateSignal()
- local gui = SIService.PromptOrderInfo:InvokeServer(PurchaseSlotID,sys,"DevProduct")
- SwitchExits(true)
- closeSignal = signal
- association = gui
- waitseconds = .2
- signal:connect(function()
- 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()
- gui:remove()
- end)
- end)
- gui.ProductInfo.Purchase.MouseButton1Click:connect(function()
- gui.ProductInfo.Purchase.Visible = false
- if SaveSlots >= MaxSaveSlots then
- SIService.PromptSystemWarning:FireServer("You've reached the maximum purchasable save slots.")
- return
- end
- market:PromptProductPurchase(plr,PurchaseSlotID)
- end)
- end;
- Save = function(SystemWindowFunctions,sys,slot)
- local gui = box.CSL:Clone()
- local default = gui.Cname.Text
- local selections
- local closeSignal = nil
- local association = nil
- local waitseconds = 0
- gui.Parent = sys
- for _,w in pairs(SIService.FindParts:InvokeServer(_G.Team.Value)) do w.Locked = true end
- local parts = SIService.FindParts:InvokeServer(_G.Team.Value,_G.Team.Value)
- for i = 0,#parts/20 do
- gui.Info.Text = i*20 .. " Owned Parts Detected In Garage"
- run.RenderStepped:wait()
- end
- gui.Info.Text = #parts.." Owned Parts Detected In Garage"
- if #parts > SavingLimit then
- VisibleExits(true)
- gui.Info.Subtitle.Text = "Sorry, your creation is too big. The max is "..SavingLimit..". Try losing some parts?"
- for _,w in pairs(SIService.FindParts:InvokeServer(_G.Team.Value)) do w.Locked = false end
- else
- gui.Cname.Visible = true
- gui.SaveLoad.Visible = true
- gui.SaveLoad.Text = "Save"
- local information = SIService.DataPersist:InvokeServer("Load","String","Creation"..slot.."Info")
- local cname = "Empty"
- if information and string.len(information) > 5 then cname = http:JSONDecode(information).Name end
- if cname ~= "Empty" and cname ~= "Noname" then gui.Cname.Text = cname; gui.Cname.ClearTextOnFocus = false end
- local function SaveCreation()
- VisibleExits(false)
- gui.Cname.Visible = false
- gui.SaveLoad.Visible = false
- gui.Info.Text = ""
- local fr = gui.LoadingBar
- local bar = fr.Bar
- local txt = fr.Action
- local model
- local positioner
- local service
- local datalen
- local actions = {
- ["Preparing to save..."] = function()
- model = Instance.new("Model",workspace)
- for _,w in pairs(parts) do w.Parent = model end
- local block = game.ReplicatedStorage.SavePositioners["Collider".._G.Team.Value]
- positioner = block:Clone()
- positioner.Parent = model
- positioner.CFrame = block.CFrame
- end;
- ["Loading Compression Library..."] = function()
- wait(.1)
- end;
- ["Compressing and Saving Project..."] = function()
- datalen = SIService.SaveModel:InvokeServer(model,slot)
- end;
- ["Writing data info to slot..."] = function()
- SIService.DataPersist:InvokeServer("Save","String","Creation"..slot.."Info",http:JSONEncode(
- {
- 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));
- PartQuantity = #parts;
- StorageConsumption = string.sub(datalen/45000,1,4);
- }))
- wait(.1)
- end;
- ["Finishing Up..."] = function()
- positioner:remove()
- for _,w in pairs(model:GetChildren()) do w.Parent = workspace end
- for _,w in pairs(SIService.FindParts:InvokeServer(_G.Team.Value)) do w.Locked = false end
- selections = SIService.SelectModel:InvokeServer(parts,BrickColor.new(1,1,1))
- wait(.1)
- end
- };
- local order = {
- "Preparing to save...";
- "Loading Compression Library...";
- "Compressing and Saving Project...";
- "Writing data info to slot...";
- "Finishing Up...";
- }
- fr.Visible = true
- local actiondone = 0
- for _,w in pairs(order) do
- txt.Text = w
- actions[w]()
- actiondone = actiondone + 1
- bar:TweenSize(UDim2.new(actiondone/#order,0,1,0),"Out","Quad",.2,true)
- end
- fr.Visible = false
- gui.Info.Text = "Save Successful"
- gui.Info.Subtitle.Text = "The parts highlighted in white have been saved successfully."
- local connect1
- local connect2
- local function erase()
- if selections then selections:remove() end
- connect1:disconnect()
- connect2:disconnect()
- end
- VisibleExits(true)
- connect1 = system.Back.MouseButton1Click:connect(erase)
- connect2 = system.Exit.MouseButton1Click:connect(erase)
- end
- gui.SaveLoad.MouseButton1Click:connect(SaveCreation)
- gui.Cname.FocusLost:connect(function(ent) if ent then SaveCreation() end end)
- end
- end;
- Load = function(SystemWindowFunctions,sys,slot)
- local gui = box.CSL:Clone()
- local closeSignal = nil
- local association = nil
- local waitseconds = 0
- local info = http:JSONDecode(SIService.DataPersist:InvokeServer("Load","String","Creation"..slot.."Info"))
- gui.Info.Text = info.Name
- gui.Info.Subtitle.Text = "Your current project will be removed from the game."
- gui.SaveLoad.Visible = true
- gui.SaveLoad.Text = "Load"
- gui.Parent = sys
- local function LoadCreation(slot)
- VisibleExits(false)
- gui.SaveLoad.Visible = false
- gui.Info.Visible = false
- local fr = gui.LoadingBar
- local bar = fr.Bar
- local txt = fr.Action
- local model
- local positioner
- local service
- local data
- local actions = {
- ["Preparing to load..."] = function()
- removeparts(SIService.FindParts:InvokeServer(_G.Team.Value))
- end;
- ["Loading Compression Library..."] = function()
- wait(.1)
- end;
- ["Decoding Project..."] = function()
- model = SIService.LoadModel:InvokeServer(slot,game.ReplicatedStorage)
- end;
- ["Setting Project Identities..."] = function()
- for _,w in pairs(model:GetChildren()) do
- if w.Name ~= "o" then w.Name = _G.Team.Value..w.Name end
- end
- end;
- ["Identifying MainCoordinatorPart..."] = function()
- model.PrimaryPart = model.o
- model.o.CanCollide = false
- end;
- ["Coordinating Model..."] = function()
- model.Parent = workspace
- model:SetPrimaryPartCFrame(game.ReplicatedStorage.SavePositioners["Collider".._G.Team.Value].CFrame)
- model.PrimaryPart:remove()
- wait(.1)
- end;
- ["Finishing Up..."] = function()
- model:MakeJoints()
- spawn(function() SIService.PerformCSMethod:InvokeServer("ManipulateParts",model,{
- Parent = workspace;
- Anchored = false;
- Locked = false;
- })end)
- end
- };
- local order = {
- "Preparing to load...";
- "Loading Compression Library...";
- "Decoding Project...";
- "Setting Project Identities...";
- "Identifying MainCoordinatorPart...";
- "Coordinating Model...";
- "Finishing Up...";
- }
- fr.Visible = true
- local actiondone = 0
- local stopwatch = tick()
- for _,w in pairs(order) do
- txt.Text = w
- actions[w]()
- actiondone = actiondone + 1
- bar:TweenSize(UDim2.new(actiondone/#order,0,1,0),"Out","Quad",.2,true)
- end
- fr.Visible = false
- gui.Info.Visible = true
- gui.Info.Text = "Load Successful"
- local timetaken = tick() - stopwatch - .3
- local wh,fr = math.modf(timetaken)
- if string.len(fr) > 5 then timetaken = string.sub(timetaken,1,string.len(wh) + 4) end
- gui.Info.Subtitle.Text = "Loading time: "..timetaken.."s. Send feedback to UndefinedMind regarding saving/loading issues."
- VisibleExits(true)
- end
- gui.SaveLoad.MouseButton1Click:connect(function() LoadCreation(slot) end)
- end
- }
- local function LaunchSaveSystem()
- for _,w in pairs(interface:GetChildren()) do w.Visible = false end
- local sys = box.SaveInterface:Clone()
- system = sys
- sys.BackgroundTransparency = 1
- function down(child) child[child:IsA("TextButton") and "BackgroundTransparency" or "ImageColor3"] = (child:IsA("TextButton") and .9 or Color3.new(.5,.5,.5)) end
- function up(child) child[child:IsA("TextButton") and "BackgroundTransparency" or "ImageColor3"] = (child:IsA("TextButton") and 1 or Color3.new( 1, 1, 1)) end
- sys.DescendantAdded:connect(function(child)
- if child:IsA("GuiButton") then
- child.AutoButtonColor = false
- child.MouseEnter:connect( function() down(child) end); child.MouseLeave:connect( function() up(child) end)
- child.MouseButton1Down:connect(function() down(child) end); child.MouseButton1Up:connect(function() up(child) clicksfx:Play() end)
- end
- end)
- local function findparent(window)
- for _,w in pairs(Hierarchy) do if _ == window.Name then return w end end
- end
- sys.Back.MouseEnter:connect( function() down(sys.Back) end); sys.Back.MouseLeave:connect( function() up(sys.Back) end)
- sys.Back.MouseButton1Down:connect(function() down(sys.Back) end); sys.Back.MouseButton1Up:connect(function() up(sys.Back) clicksfx:Play() end)
- sys.Exit.MouseEnter:connect( function() down(sys.Back) end); sys.Exit.MouseLeave:connect( function() up(sys.Back) end)
- sys.Exit.MouseButton1Down:connect(function() down(sys.Back) end); sys.Exit.MouseButton1Up:connect(function() up(sys.Back) clicksfx:Play() end)
- local backDB = false
- local exitDB = false
- sys.Back.MouseButton1Click:connect(function()
- if backDB or not sys.Back.Selected then return end
- backDB = true
- local window = sys.Window:GetChildren()[1]
- local before = findparent(window)
- if closeSignal and window == association then closeSignal:fire() wait(waitseconds or 0) else window:remove() end
- waitseconds = nil
- SystemWindowFunctions[before](SystemWindowFunctions,sys.Window)
- backDB = false
- end)
- sys.Exit.MouseButton1Click:connect(function()
- if exitDB or not sys.Exit.Selected then return end
- exitDB = true
- local window = sys.Window:GetChildren()[1]
- local before = findparent(window)
- if before then
- if closeSignal and window == association then closeSignal:fire() wait(waitseconds or 0) else window:remove() end
- else
- window:remove()
- end
- for i = .25,1,.05 do
- sys.BackgroundTransparency = i
- run.RenderStepped:wait()
- end
- sys:remove()
- system = nil
- for _,w in pairs(interface:GetChildren()) do w.Visible = true end
- end)
- sys.Parent = interface
- for i = 1,.25,-.05 do
- sys.BackgroundTransparency = i
- run.RenderStepped:wait()
- end
- SystemWindowFunctions.Main(SystemWindowFunctions,sys.Window)
- end
- button.MouseButton1Click:connect(LaunchSaveSystem)
- end
- }
- local descriptions = {GarageControls = "Garage Controls", TrustSystem = "Launch Trust/Block System", Notifications = "Notifications", SaveSystem = "Launch Save System"}
- for _,v in pairs(gui.Bar:GetChildren()) do
- if buttonfunctions[v.Name] then buttonfunctions[v.Name](v) end
- if v:findFirstChild("ButtonImg") then
- v.MouseEnter:connect(function()
- if v.ButtonImg.ImageColor3 == Color3.new(0,0,0) then return end
- hoversfx:Play()
- v.ButtonImg:TweenSizeAndPosition(UDim2.new(1,0,1,0),UDim2.new(0,0,0,0),"Out","Quad",.2,true)
- if descriptions[v.Name] then gui.NameOfButton.Text = descriptions[v.Name] gui.NameOfButton.Visible = true end
- end)
- v.MouseLeave:connect(function()
- if v.ButtonImg.ImageColor3 == Color3.new(0,0,0) then return end
- v.ButtonImg:TweenSizeAndPosition(UDim2.new(1,-20,1,-20),UDim2.new(0,10,0,10),"Out","Quad",.2,true)
- gui.NameOfButton.Visible = false
- end)
- end
- end
- end;
- InstanceTracker = function(gui)
- local TweenVersion = 1
- local TVUDim = {UDim2.new(.1,0,.95,0),UDim2.new(.1,0,.75,0),UDim2.new(.1,0,.5,0)}
- local int = gui.Interface
- local info = int.Information
- local section = int.Section
- local count = int.Count
- local dtotal = int.DisplayedTotal
- local garage = int.Garage
- local perc = int.Percent
- local world = int.World
- local igt = int.InformationGatheringTime
- local function UpdateTracker()
- local starttime = tick()
- local teamfilter = section.Client.GradientBlocks.Visible == false and _G.Team.Value or false
- local garagefilter = garage.GradientBlocks.Visible == true and _G.Team.Value or false
- local unitinst = count.GradientBlocks.Visible == true and true or false
- local locate = SIService.FindParts
- local Counts = {
- ["Parts"] =
- #locate:InvokeServer(teamfilter,garagefilter,"Parts") +
- #locate:InvokeServer(teamfilter,garagefilter,"Wedges") +
- #locate:InvokeServer(teamfilter,garagefilter,"CornerWedges") +
- #locate:InvokeServer(teamfilter,garagefilter,"Truss") +
- #locate:InvokeServer(teamfilter,garagefilter,"Cylinders") +
- #locate:InvokeServer(teamfilter,garagefilter,"Spheres") +
- #locate:InvokeServer(teamfilter,garagefilter,"Wheels");
- ["Body Movers"] =
- #locate:InvokeServer(teamfilter,garagefilter,"Followers") +
- #locate:InvokeServer(teamfilter,garagefilter,"Hovers") +
- #locate:InvokeServer(teamfilter,garagefilter,"Stablizers") +
- #locate:InvokeServer(teamfilter,garagefilter,"Thrusters");
- ["Dynamic Lighting"] =
- #locate:InvokeServer(teamfilter,garagefilter,"Lights");
- ["Bumpers"] =
- #locate:InvokeServer(teamfilter,garagefilter,"Bumpers");
- ["Seats"] =
- #locate:InvokeServer(teamfilter,garagefilter,"Vehicle Seats") +
- #locate:InvokeServer(teamfilter,garagefilter,"Passenger Seats");
- ["Weapons"] =
- #locate:InvokeServer(teamfilter,garagefilter,"Weapons")
- }
- local total = Counts["Parts"] + Counts["Body Movers"] + Counts["Dynamic Lighting"] + Counts["Bumpers"] + Counts["Seats"] + Counts["Weapons"]
- local svalues = {Counts["Parts"]; Counts["Body Movers"]; Counts["Dynamic Lighting"]; Counts["Bumpers"]; Counts["Seats"]; Counts["Weapons"]}
- table.sort(svalues)
- for i = 6,1,-1 do
- local namespace
- local value = svalues[i]
- for k,w in pairs(Counts) do
- if w == value then namespace = k Counts[k] = nil break end
- end
- local button = info[namespace]
- button.Position = UDim2.new(0,0,(6 - i)/6,0)
- button.Units.Text = unitinst and value.." Inst." or ( total == 0 and "0%" or string.sub(value/total*100,1,4).."%")
- end
- dtotal.Text = teamfilter and total.."/"..SavingLimit or total
- if total > SavingLimit and teamfilter then
- dtotal.TextColor3 = ConvertColor3(Color3.new(255,85,127))
- else
- dtotal.TextColor3 = Color3.new(1,1,1)
- end
- igt.Text = "IGT = "..tick() - starttime.."s"
- end
- count.MouseButton1Click:connect(function()
- if count.GradientBlocks.Visible then return end
- clicksfx:Play()
- count.GradientBlocks.Visible = true
- perc.GradientBlocks.Visible = false
- UpdateTracker()
- end)
- perc.MouseButton1Click:connect(function()
- if perc.GradientBlocks.Visible then return end
- clicksfx:Play()
- perc.GradientBlocks.Visible = true
- count.GradientBlocks.Visible = false
- UpdateTracker()
- end)
- section.Client.MouseButton1Click:connect(function()
- if not section.Client.GradientBlocks.Visible then return end
- clicksfx:Play()
- section.Client.GradientBlocks.Visible = false
- section["All Clients"].GradientBlocks.Visible = true
- UpdateTracker()
- end)
- section["All Clients"].MouseButton1Click:connect(function()
- if not section["All Clients"].GradientBlocks.Visible then return end
- clicksfx:Play()
- section["All Clients"].GradientBlocks.Visible = false
- section.Client.GradientBlocks.Visible = true
- UpdateTracker()
- end)
- garage.MouseButton1Click:connect(function()
- if garage.GradientBlocks.Visible then return end
- clicksfx:Play()
- garage.GradientBlocks.Visible = true
- world.GradientBlocks.Visible = false
- UpdateTracker()
- end)
- world.MouseButton1Click:connect(function()
- if world.GradientBlocks.Visible then return end
- clicksfx:Play()
- world.GradientBlocks.Visible = true
- garage.GradientBlocks.Visible = false
- UpdateTracker()
- end)
- dtotal.MouseButton1Click:connect(function()
- TweenVersion = TweenVersion == 3 and 1 or TweenVersion + 1
- int:TweenPosition(TVUDim[TweenVersion],"Out","Linear",.3,true)
- clicksfx:Play()
- end)
- spawn(function()
- while wait(.5) do
- UpdateTracker()
- end
- end)
- end;
- Tools = function(gui)
- local tools = gui.Toolbar
- local window = gui.Window
- local connections = {}
- local gui3ds = {}
- local Dragger = Instance.new("Dragger")
- local SB = Instance.new("SelectionBox",plr.PlayerGui)
- local DeleteSB = Instance.new("SelectionBox",workspace)
- local DeleteLasso = Instance.new("SelectionPartLasso",workspace)
- DeleteSB.Color = BrickColor.new("Really red")
- DeleteLasso.Color = BrickColor.new("Really red")
- local materialSelected = createDropUp(
- window.General.Window.Composition.Edit.Material.DropUpBox.Click,
- window.General.Window.Composition.Edit.Material.DropUpBox.Option,
- window.General.Window.Composition.Edit.Material.DropUpBox.Box.DropUp,
- Enum.Material:GetEnumItems()
- )
- local surfaceSelected = createDropUp(
- window.General.Window.Surface.DropUpBox.Click,
- window.General.Window.Surface.DropUpBox.Option,
- window.General.Window.Surface.DropUpBox.Box.DropUp,
- Enum.SurfaceType:GetEnumItems()
- )
- local ptypeSelected = createDropUp(
- window.General.Window["Create Part"].DropUpBox.Click,
- window.General.Window["Create Part"].DropUpBox.Option,
- window.General.Window["Create Part"].DropUpBox.Box.DropUp,
- plr.PlayerGui.Parts:GetChildren()
- )
- plr.CharacterAdded:connect(function(chr)
- DeleteLasso.Humanoid = chr:WaitForChild("Humanoid")
- end)
- local function createLinkedLasso(parent)
- local lasso = Instance.new("SelectionPartLasso",parent)
- lasso.Humanoid = plr.Character:findFirstChild("Humanoid")
- plr.CharacterAdded:connect(function(chr) lasso.Humanoid = plr.Character:WaitForChild("Humanoid") end)
- return lasso
- end
- local function ClearAllConnections()
- for _,w in pairs(connections) do connections:disconnect() connections[_] = nil end
- end
- local function ClearAll3dGuis()
- for _,w in pairs(gui3ds) do w:remove() gui3ds[_] = nil end
- end
- local function Permission(part)
- if string.sub(part.Name,1,1) == tostring(_G.Team.Value) then
- return true
- else
- return SIService.GetPermissions:InvokeServer(SIService.GetPlayerFromGarage:InvokeServer(string.sub(part.Name,1,1)),true).enablebuildingtools
- end
- end
- local function viewmsg(txt,msg,returnto,lifetime)
- spawn(function()
- txt.Text = msg
- wait(lifetime or 2)
- txt.Text = returnto
- end)
- end
- spawn(function()
- DeleteLasso.Humanoid = plr.Character and plr.Character:WaitForChild("Humanoid") or plr.CharacterAdded:wait():WaitForChild("Humanoid")
- for i = 1,1050 do
- BrickColors[BrickColor.new(i).Name] = BrickColor.new(i)
- end
- local iteration = 0
- for _,w in pairs(BrickColors) do
- iteration = iteration + 1
- local representation = window.General.Window.Paint.Color.Color:Clone()
- representation.BackgroundColor3 = Color3.new(w.Color)
- representation.Name = w.Name
- representation.Position = UDim2.new(iteration%5 ~= 0 and iteration%5/5 -.2 or .8,1,math.floor(iteration/5)*.1,1)
- representation.Parent = window.General.Window.Paint.Color.BrickColors
- representation.Visible = true
- end
- window.General.Window.Paint.Color.Color:remove()
- end)
- local generalconnections = {}
- local general3dguis = {}
- local functions = {
- General = {
- equip = function()
- local con = window.General
- con.Visible = true
- function VerifyPart(part)
- if not part then return end
- if part.Locked then return end
- if not Permission(part) then return end
- return true
- end
- local functions = {
- Paint = {
- equip = function(ui)
- colorisout = ui.Change.Text == "Close"
- generalconnections.pme = ui.Change.MouseEnter:connect(function() ui.Change.BackgroundTransparency = .9 end)
- generalconnections.pml = ui.Change.MouseLeave:connect(function() ui.Change.BackgroundTransparency = 1 end)
- generalconnections.pmc = ui.Change.MouseButton1Click:connect(function()
- colorisout = not colorisout
- ui.Color.ScrollingEnabled = not colorisout
- ui.Color:TweenSize(UDim2.new(1,0,colorisout and 0 or -5,0),"Out","Quad",.2,true)
- ui.Change.Text = colorisout and "Close" or "Change"
- ui.Change.BackgroundTransparency = 1
- end)
- local paintSB = Instance.new("SelectionBox",workspace)
- local paintlasso = createLinkedLasso(workspace)
- paintSB.Color = BrickColor.new(ui.PickedColor.TextColor3)
- paintlasso.Color = BrickColor.new(ui.PickedColor.TextColor3)
- table.insert(general3dguis,paintSB)
- table.insert(general3dguis,paintlasso)
- local previoustarget
- generalconnections.ptc = mouse.Move:connect(function()
- if previoustarget == mouse.Target then return end
- previoustarget = mouse.Target
- if not VerifyPart(mouse.Target) then paintSB.Adornee = nil paintlasso.Part = nil return end
- paintSB.Adornee = mouse.Target
- paintlasso.Part = mouse.Target
- end)
- generalconnections.pmu = mouse.Button1Up:connect(function()
- if not paintSB.Adornee then return end
- paintSB.Adornee.BrickColor = paintSB.Color
- end)
- for _,w in pairs(ui.Color.BrickColors:GetChildren()) do
- generalconnections[w.Name.."pmc"] = w.MouseButton1Click:connect(function()
- paintSB.Color = BrickColor.new(w.BackgroundColor3)
- paintlasso.Color = BrickColor.new(w.BackgroundColor3)
- ui.PickedColor.Text = w.Name
- ui.PickedColor.TextColor3 = w.BackgroundColor3
- end)
- end
- end;
- unequip = function(ui) end
- };
- Composition = {
- equip = function(ui)
- local frame = ui.Notice.Warning
- Global.Compositiondefault = "Click on a part to edit it's composition."
- local function warnPlayer()
- ui.Notice.Text = ""
- frame.Position = UDim2.new(0,0,1,0)
- frame.Visible = true
- frame:TweenPosition(UDim2.new(0,0,.6,0),"Out","Quad",.2,true)
- end
- local compSB = Instance.new("SelectionBox",workspace)
- local complasso = createLinkedLasso(workspace)
- compSB.Color = BrickColor.White()
- complasso.Color = BrickColor.White()
- table.insert(general3dguis,compSB)
- table.insert(general3dguis,complasso)
- local previoustarget
- generalconnections.ctc = mouse.Move:connect(function()
- if mouse.Target == previoustarget then return end
- previoustarget = mouse.Target
- if not VerifyPart(mouse.Target) then compSB.Adornee = nil complasso.Part = nil return end
- compSB.Adornee = mouse.Target
- complasso.Part = mouse.Target
- end)
- generalconnections.cmu = mouse.Button1Up:connect(function()
- if Global.ccr then Global.ccr:disconnect() Global.ccr = nil end
- if Global.cct then Global.cct:disconnect() Global.cct = nil end
- if Global.ccm then Global.ccm:disconnect() Global.ccm = nil end
- frame.Position = UDim2.new(0,0,1,0)
- frame.Visible = false
- ui.Notice.Text = Global.Compositiondefault
- ui.Edit.Visible = false
- ui.Notice.Text = Global.Compositiondefault
- if not compSB.Adornee then return end
- local part = compSB.Adornee
- if string.sub(part.Name,2,2) == ("F" or "H" or "S" or "X" or "Y" or "Z" or "W") then warnPlayer() return end
- local escr = ui.Edit
- escr.Material.DropUpBox.Box.Text = part.Material.Name
- escr.Reflect.Reflectance.Text = part.Reflectance
- escr.Trans.Trans.Text = part.Transparency
- Global.ccr = createC2Scale(escr.Reflect.Left,escr.Reflect.Right,0,1,.05,part.Reflectance):connect(function(value)
- part.Reflectance = value
- escr.Reflect.Reflectance.Text = value
- end)
- 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)
- part.Transparency = value
- escr.Trans.Trans.Text = value
- end)
- Global.ccm = materialSelected:connect(function(material)
- part.Material = material
- escr.Material.DropUpBox.Box.Text = material
- end)
- ui.Notice.Text = ""
- ui.Edit.Visible = true
- end)
- end;
- unequip = function(ui)
- local frame = ui.Notice.Warning
- if Global.ccr then Global.ccr:disconnect() Global.ccr = nil end
- if Global.cct then Global.cct:disconnect() Global.cct = nil end
- if Global.ccm then Global.ccm:disconnect() Global.ccm = nil end
- frame.Position = UDim2.new(0,0,1,0)
- frame.Visible = false
- ui.Notice.Text = Global.Compositiondefault
- ui.Edit.Visible = false
- end
- };
- Surface = {
- equip = function(ui)
- local surfSS = Instance.new("SurfaceSelection",workspace)
- local surflasso = createLinkedLasso(workspace)
- surfSS.Color = BrickColor.White()
- surflasso.Color = BrickColor.White()
- table.insert(general3dguis,surfSS)
- table.insert(general3dguis,surflasso)
- generalconnections.scs = surfaceSelected:connect(function(surface)
- ui.DropUpBox.Box.Text = surface
- end)
- local previoustarget = mouse.Target
- local previoussurface = mouse.TargetSurface
- generalconnections.stc = mouse.Move:connect(function(prop)
- if previoustarget == mouse.Target and previoussurface == mouse.TargetSurface then return end
- previoustarget = mouse.Target
- previoussurface = mouse.TargetSurface
- if not VerifyPart(mouse.Target) then surfSS.Adornee = nil surflasso.Part = nil return end
- surfSS.Adornee = mouse.Target
- surfSS.TargetSurface = mouse.TargetSurface
- surflasso.Part = mouse.Target
- end)
- generalconnections.smu = mouse.Button1Up:connect(function()
- if not surfSS.Adornee then return end
- surfSS.Adornee[surfSS.TargetSurface.Name.."Surface"] = ui.DropUpBox.Box.Text
- end)
- end;
- unequip = function(ui)end
- };
- ["Create Part"] = {
- equip = function(ui)
- generalconnections.zct = ptypeSelected:connect(function(parttype)
- ui.DropUpBox.Box.Text = parttype
- end)
- generalconnections.zmd = mouse.Button1Down:connect(function()
- pcall(function() Dragger:MouseUp() end)
- local target = plr.PlayerGui.Parts[ui.DropUpBox.Box.Text]:GetChildren()[1]:Clone()
- target.Name = _G.Team.Value..target.Name
- target.Anchored = false
- target.Parent = workspace
- target.Position = Vector3.new(math.floor(mouse.Hit.x),math.floor(mouse.Hit.y),math.floor(mouse.Hit.z))
- SB.Adornee = target
- pcall(function() Dragger:MouseDown(target,Vector3.new(0,0,0),{target}) end)
- generalconnections.zku = mouse.KeyUp:connect(function(key)
- if key:lower() == "t" then
- target.CFrame = target.CFrame * CFrame.Angles(math.rad(90),0,0)
- elseif key:lower() == "r" then
- target.CFrame = target.CFrame * CFrame.Angles(0,math.rad(90),0)
- end
- end)
- generalconnections.zmm = mouse.Move:connect(function()
- mouse.Icon = "rbxasset://textures\\GrabRotateCursor.png"
- pcall(function() Dragger:MouseMove(mouse.UnitRay) end)
- end)
- generalconnections.zcu = mouse.Button1Up:connect(function()
- generalconnections.zcu:disconnect()
- generalconnections.zmm:disconnect()
- generalconnections.zku:disconnect()
- SB.Adornee = nil
- pcall(function() Dragger:MouseUp() end)
- mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
- end)
- end)
- end;
- unequip = function(ui)
- SB.Adornee = nil
- pcall(function() Dragger:MouseUp() end)
- mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
- end
- };
- Resize = {
- equip = function(ui)
- local previousDistance
- local handlesoverride = false
- local defaultmsg = "Click on a part to resize it."
- local resSB = Instance.new("SelectionBox",plr.PlayerGui)
- local reslasso = createLinkedLasso(workspace)
- local reshandles = Instance.new("Handles",plr.PlayerGui)
- reshandles.Color = BrickColor.Blue()
- table.insert(general3dguis,resSB)
- table.insert(general3dguis,reslasso)
- table.insert(general3dguis,reshandles)
- generalconnections.rmu = mouse.Button1Up:connect(function()
- if handlesoverride then handlesoverride = false return end
- resSB.Adornee = nil
- reslasso.Part = nil
- reshandles.Adornee = nil
- ui.Edit.Visible = false
- if generalconnections.watchsize then generalconnections.watchsize:disconnect() end
- if not mouse.Target or not mouse.Target:IsA("BasePart") then return end
- if mouse.Target.Locked then viewmsg(ui,"This part is locked.",defaultmsg) return end
- if not Permission(mouse.Target) then viewmsg(ui,"You are not trusted to have permission to resize this part.",defaultmsg) return end
- local target = mouse.Target
- resSB.Adornee = target
- reslasso.Part = target
- reshandles.Adornee = target
- reshandles.Faces = target.ResizeableFaces
- ui.Edit.X.Value.Text = target.Size.X
- ui.Edit.Y.Value.Text = target.Size.Y
- ui.Edit.Z.Value.Text = target.Size.Z
- ui.Edit.Visible = true
- generalconnections.watchsize = target.Changed:connect(function(prop)
- if prop ~= "Size" then return end
- ui.Edit.X.Value.Text = target.Size.X
- ui.Edit.Y.Value.Text = target.Size.Y
- ui.Edit.Z.Value.Text = target.Size.Z
- end)
- end)
- generalconnections.rmd = reshandles.MouseDrag:connect(function(normal,distance)
- if reshandles.Adornee then
- local delta = distance - previousDistance
- if math.abs(delta) >= reshandles.Adornee.ResizeIncrement then
- local sizeDelta = math.floor(delta / reshandles.Adornee.ResizeIncrement + 0.5) * reshandles.Adornee.ResizeIncrement
- if normal.Name == ("Top" or "Bottom") then
- if reshandles.Adornee.Size.Y + sizeDelta > PartLimits.MaxSize then return end
- elseif normal.Name == ("Left" or "Right") then
- if reshandles.Adornee.Size.X + sizeDelta > PartLimits.MaxSize then return end
- elseif normal.Name == ("Back" or "Front") then
- if reshandles.Adornee.Size.Z + sizeDelta > PartLimits.MaxSize then return end
- end
- if reshandles.Adornee:Resize(normal,sizeDelta) then
- previousDistance = distance
- end
- end
- end
- end)
- generalconnections.rbd = reshandles.MouseButton1Down:connect(function() previousDistance = 0 handlesoverride = true end)
- generalconnections.rbu = reshandles.MouseButton1Up:connect(function() wait(.1) handlesoverride = false end)
- end;
- unequip = function(ui)
- ui.Edit.Visible = false
- end
- }
- }
- local function emptyConnections()
- for _,w in pairs(generalconnections) do w:disconnect() end
- generalconnections = {}
- end
- local function empty3Dguis()
- for _,w in pairs(general3dguis) do w:remove() end
- general3dguis = {}
- end
- local function unequipAll()
- for _,w in pairs(con.Parts:GetChildren()) do
- if w.BackgroundTransparency ~= 1 then
- functions[w.Name].unequip(con.Window[w.Name])
- con.Window[w.Name].Visible = false
- w.BackgroundTransparency = 1
- end
- emptyConnections()
- empty3Dguis()
- end
- end
- local function returnEquipped()
- for _,w in pairs(con.Parts:GetChildren()) do
- if w.BackgroundTransparency ~= 1 then return w.Name end
- end
- end
- for _,w in pairs(con.Parts:GetChildren()) do
- local function linkEvents()
- if returnEquipped() == w.Name then
- functions[w.Name].unequip(con.Window[w.Name])
- con.Window[w.Name].Visible = false
- w.BackgroundTransparency = 1
- emptyConnections()
- empty3Dguis()
- return
- end
- if returnEquipped() then unequipAll() end
- w.BackgroundTransparency = .8
- con.Desc.Text = w.Name
- con.Desc.Visible = true
- con.Window[w.Name].Visible = true
- functions[w.Name].equip(con.Window[w.Name])
- end
- connections["general"..w.Name.."mouseEnterLink"] = w[w.Name].MouseEnter:connect(function()
- if returnEquipped() then return end
- con.Desc.Text = w.Name
- con.Desc.Visible = true
- end)
- connections["general"..w.Name.."mouseLeaveLink"] = w[w.Name].MouseLeave:connect(function()
- if returnEquipped() then return end
- con.Desc.Visible = false
- end)
- connections["general"..w.Name.."Link"] = w[w.Name].MouseButton1Click:connect(linkEvents)
- connections["general"..w.Name.."KeyboardLink"] = mouse.KeyUp:connect(function(key)
- if key:upper() == w.Hotkey.Text then linkEvents() end
- end)
- end
- if returnEquipped() then
- functions[returnEquipped()].equip(con.Window[returnEquipped()])
- end
- end;
- unequip = function()
- for _,w in pairs(generalconnections) do w:disconnect() end
- for _,w in pairs(general3dguis) do w:remove() end
- generalconnections = {}
- general3dguis = {}
- end
- };
- Copy = {
- equip = function()
- local txt = window.Copy
- txt.Visible = true
- local defaultmsg = "Click on a part to clone it. Click on a part and hold to clone and drag it."
- connections.clonedown = mouse.Button1Down:connect(function()
- if not mouse.Target or not mouse.Target:IsA("BasePart") then return end
- if mouse.Target.Locked then viewmsg(txt,"This part is locked.",defaultmsg) return end
- if not Permission(mouse.Target) then viewmsg(txt,"You are not trusted to have permission to clone this part.",defaultmsg) return end
- local C = mouse.Target
- local target = C:Clone()
- target.Parent = workspace
- target.Position = C.Position + Vector3.new(0,0.005,0)
- target:MakeJoints()
- SB.Adornee = target
- pcall(function() Dragger:MouseDown(target,Vector3.new(0,0,0),{target}) end)
- connections.clonekeyup = mouse.KeyUp:connect(function(key)
- if key:lower() == "t" then
- target.CFrame = target.CFrame * CFrame.Angles(math.rad(90),0,0)
- elseif key:lower() == "r" then
- target.CFrame = target.CFrame * CFrame.Angles(0,math.rad(90),0)
- end
- end)
- connections.clonemousemove = mouse.Move:connect(function()
- mouse.Icon = "rbxasset://textures\\GrabRotateCursor.png"
- pcall(function() Dragger:MouseMove(mouse.UnitRay) end)
- end)
- connections.cloneup = mouse.Button1Up:connect(function()
- connections.cloneup:disconnect()
- connections.clonemousemove:disconnect()
- connections.clonekeyup:disconnect()
- SB.Adornee = nil
- pcall(function() Dragger:MouseUp() end)
- mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
- end)
- end)
- end;
- unequip = function()
- SB.Adornee = nil
- pcall(function() Dragger:MouseUp() end)
- mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
- end
- };
- Delete = {
- equip = function()
- local txt = window.Delete
- txt.Visible = true
- local defaultmsg = "Click on a part to delete it."
- local previoustarget
- connections.deletesbplacement = mouse.Move:connect(function()
- if previoustarget == mouse.Target then return end
- previoustarget = mouse.Target
- if mouse.Target and mouse.Target:IsA("BasePart") and not mouse.Target.Locked and Permission(mouse.Target) then
- DeleteSB.Adornee = mouse.Target
- DeleteLasso.Part = mouse.Target
- else
- DeleteSB.Adornee = nil
- DeleteLasso.Part = nil
- end
- end)
- connections.deleteup = mouse.Button1Up:connect(function()
- if DeleteSB.Adornee then
- DeleteSB.Adornee:remove()
- DeleteSB.Adornee = nil
- DeleteLasso.Part = nil
- end
- end)
- end;
- unequip = function()
- DeleteSB.Adornee = nil
- DeleteLasso.Part = nil
- end
- };
- Move = {
- equip = function()
- local txt = window.Move
- txt.Visible = true
- local defaultmsg = "Click and hold on a part to move it."
- connections.movedown = mouse.Button1Down:connect(function()
- if not mouse.Target or not mouse.Target:IsA("BasePart") then return end
- if mouse.Target.Locked then viewmsg(txt,"This part is locked.",defaultmsg) return end
- if not Permission(mouse.Target) then viewmsg(txt,"You are not trusted to have permission to move this part.",defaultmsg) return end
- local target = mouse.Target
- SB.Adornee = target
- pcall(function() Dragger:MouseDown(target,Vector3.new(0,0,0),{target}) end)
- connections.movekeyup = mouse.KeyUp:connect(function(key)
- if key:lower() == "t" then
- target.CFrame = target.CFrame * CFrame.Angles(math.rad(90),0,0)
- elseif key:lower() == "r" then
- target.CFrame = target.CFrame * CFrame.Angles(0,math.rad(90),0)
- end
- end)
- connections.movemousemove = mouse.Move:connect(function()
- mouse.Icon = "rbxasset://textures\\GrabRotateCursor.png"
- pcall(function() Dragger:MouseMove(mouse.UnitRay) end)
- end)
- connections.moveup = mouse.Button1Up:connect(function()
- connections.moveup:disconnect()
- connections.movemousemove:disconnect()
- connections.movekeyup:disconnect()
- SB.Adornee = nil
- pcall(function() Dragger:MouseUp() end)
- mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
- end)
- end)
- end;
- unequip = function()
- SB.Adornee = nil
- pcall(function() Dragger:MouseUp() end)
- mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
- end
- };
- }
- local function emptyConnections()
- for _,w in pairs(connections) do w:disconnect() end
- connections = {}
- end
- local function empty3Dguis()
- for _,w in pairs(gui3ds) do w:remove() end
- gui3ds = {}
- end
- local function unequipAll()
- for _,w in pairs(tools:GetChildren()) do
- if w.BackgroundTransparency ~= 1 then
- functions[w.Name].unequip(gui.Window[w.Name])
- window[w.Name].Visible = false
- w.BackgroundTransparency = 1
- end
- emptyConnections()
- empty3Dguis()
- end
- end
- local function returnEquipped()
- for _,w in pairs(tools:GetChildren()) do
- if w.BackgroundTransparency ~= 1 then return w.Name end
- end
- end
- for _,w in pairs(tools:GetChildren()) do
- local function linkEvents()
- if returnEquipped() == w.Name then
- functions[w.Name].unequip(window[w.Name])
- window[w.Name].Visible = false
- w.BackgroundTransparency = 1
- emptyConnections()
- empty3Dguis()
- return
- end
- if returnEquipped() then unequipAll() end
- w.BackgroundTransparency = .9
- functions[w.Name].equip(window[w.Name])
- end
- w[w.Name].MouseButton1Click:connect(linkEvents)
- mouse.KeyUp:connect(function(key)
- if key:upper() == w.Hotkey.Text then linkEvents() end
- end)
- end
- end;
- }
- for _,w in pairs(interface:GetChildren()) do
- if InterfaceFunctions[w.Name] then InterfaceFunctions[w.Name](w) end
- end
- interface.Parent = plr.PlayerGui
- game.StarterGui:SetCoreGuiEnabled("Backpack",false)
- spawn(function()
- local function CheckPhysicsFPS()
- local indexSuc, indexErr = pcall(function() workspace.GetRealPhysicsFPS() end)
- if indexErr:match("GetRealPhysicsFPS") then
- local suc, err = pcall(function()
- if workspace:GetRealPhysicsFPS() > PhysicsFPSLimit then
- plr:Kick()
- end
- end)
- if not suc then
- plr:Kick()
- end
- else
- plr:Kick()
- end
- end
- while wait(1) do
- CheckPhysicsFPS()
- end
- end)
- for _,ids in pairs(GamepassIDs) do
- if SIService.HasPass:InvokeServer(ids) then FreeSlots = FreeSlots + 1 end
- end
- SaveSlots = FreeSlots + (SIService.DataPersist:InvokeServer("Load","Number","BoughtSlots") or 0)
- local WipedId = SIService.DataPersist:InvokeServer("Load","Number","SaveWipe")
- if WipedId ~= SaveWipe then
- for i = 1,SaveSlots do
- SIService.DataPersist:InvokeServer("Save","String","Creation"..i,"")
- SIService.DataPersist:InvokeServer("Save","String","Creation"..i.."Info","")
- end
- SIService.DataPersist:InvokeServer("Save","Number","SaveWipe",SaveWipe)
- if WipedId and WipedId > 0 then SIService.PromptSystemWarning:FireServer("Your saves have been wiped.") end
- end
- spawn(function()
- local loading = plr.PlayerGui.Other.Loading
- loading.description.Text = "Preparing to load game content URLs..."
- local cp = game:GetService("ContentProvider")
- local Content = {
- {name = "WeaponMeshId", url = "http://www.roblox.com/asset/?id=1033714"};
- {name = "BumperTexture", url = "rbxassetid://150281996"};
- {name = "PartLockImg", url = "rbxassetid://179760594"};
- {name = "PartUnlockImg", url = "rbxassetid://179760592"};
- }
- function findContent(scope)
- for _,w in pairs(scope:GetChildren()) do
- if w:IsA("ImageLabel" or "ImageButton") then
- table.insert(Content,{name = w.Name, url = w.Image})
- elseif w:IsA("Sound") then
- table.insert(Content,{name = w.Name, url = w.SoundId})
- run.RenderStepped:wait()
- end
- findContent(w)
- end
- end
- loading.Visible = true
- findContent(plr)
- findContent(game.ReplicatedStorage)
- findContent(workspace)
- for _,w in pairs(Content) do
- loading.description.Text = "Loading "..w.name.." ["..w.url.."]"
- cp:Preload(w.url)
- repeat wait() until cp.RequestQueueSize == 0
- loading.Bar:TweenSize(UDim2.new(_/#Content,0,1,0),"Out","Quad",.2,true)
- end
- loading.description.Text = "Game Content Loaded."
- loading:TweenPosition(UDim2.new(0,0,0,-25),"Out","Quad",1,true,function() loading:remove() end)
- end)
- local ClientSidedNotes = [[
- Reminders:
- Security Measures are needed
- Don't forget the fancy loading options
- Remeber to finish the trust system and garage controls
- Trust system Reset All Permissions button is unscripted
- Don't forget to give the interface another makeover
- Updates:
- Interface remastered in under 2 hours
- Cy-Browser Sizing Bugs are squashed
- Added the instance tracker, its basically an
- extremely advanced and decorated part counter
- Part functionality
- ]]
- print [[
- Code Ran Successfully
- Coded by TochiWasHere or UndefinedMind
- printing Update Information to Client...
- Client Database Code Information Last Updated: 5:53 AM EST, 11/24/14
- (c) Missing Studios
- printing Client-sided notes...
- ]]
- print(ClientSidedNotes)
Add Comment
Please, Sign In to add comment