helloitsdeleted

ReplicateUI

Oct 3rd, 2020
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.10 KB | None | 0 0
  1. -- Original: https://pastebin.com/raw/9CkmhJj2
  2. local screenGui = game:GetObjects("rbxassetid://3546404827")[1]
  3.   local mainFrame = screenGui.Frame
  4.     local pages = mainFrame.Pages
  5.       local pageLayout = pages.UIPageLayout
  6.       local pageScripts = pages.Scripts
  7.         local interactiveButton = pageScripts.Character.Elements.TextButton
  8.         local utility = pageScripts.Utility
  9.           local utilityElements = utility.Elements
  10.       local pageOptions = pages.Options
  11.     local titleFrame = mainFrame.Title
  12.     local toolbar = mainFrame.Toolbar
  13.  
  14. screenGui.LocalScript:Destroy()
  15. screenGui.Parent = game:GetService("CoreGui")
  16. interactiveButton.Parent = nil
  17. mainFrame.Visible = true
  18.  
  19. gripCenter = CFrame.new(0, 0, 1) * CFrame.Angles(math.rad(90), 0, 0)
  20. offset = CFrame.Angles(0, 0, 0)
  21.  
  22. _player = {
  23.     p = game:GetService("Players").LocalPlayer;
  24.     b = function()
  25.         return _player.p:FindFirstChild("Backpack")
  26.     end;
  27.     c = function()
  28.         return _player.p.Character
  29.     end;
  30. }
  31. _functions = {
  32.     respawn = function()
  33.         local c = _player.c()
  34.         if workspace:FindFirstChild(_player.p.Name) then
  35.             spawn(function()
  36.                 wait(.5)
  37.                 if _player.c() ~= workspace:FindFirstChild(_player.p.Name) then
  38.                     workspace:FindFirstChild(_player.p.Name):BreakJoints()
  39.                 end
  40.             end)
  41.         end
  42.         if c then
  43.             c:BreakJoints()
  44.             c:ClearAllChildren()
  45.         end
  46.         local newChar = Instance.new("Model", workspace)
  47.         local hum = Instance.new("Humanoid", newChar)
  48.         local torso = Instance.new("Part", newChar)
  49.         newChar.Name = "respawn_"
  50.         torso.Name = "Torso"
  51.         torso.Transparency = 1
  52.         _player.p.Character = newChar
  53.         torso.Name = ""
  54.         torso.CanCollide = false
  55.         newChar:MoveTo(Vector3.new(999999, 999999, 999999))
  56.     end;
  57.     tools = function(int)
  58.         local toolamount = int or 200
  59.        
  60.         local LocalPlayer = game:GetService("Players").LocalPlayer
  61.         local runservice = game:GetService("RunService")
  62.         LocalPlayer.Character:FindFirstChild("Humanoid"):UnequipTools()
  63.         local currentamount = #LocalPlayer.Backpack:GetChildren()
  64.         LocalPlayer.Character.Archivable = true
  65.         local tempchar = LocalPlayer.Character:Clone()
  66.         local lastchar = nil
  67.         tempchar.Parent = workspace
  68.         local savepos = LocalPlayer.Character:FindFirstChild("HumanoidRootPart").CFrame
  69.         local renderstepped = runservice.RenderStepped:Connect(function()
  70.             workspace.CurrentCamera.CameraSubject = tempchar:FindFirstChild("Humanoid")
  71.             for _, tool in pairs(LocalPlayer.Backpack:GetChildren()) do
  72.                 if tool:IsA("Tool") then
  73.                     tool.Parent = LocalPlayer
  74.                 end
  75.             end
  76.             for _, char in pairs(workspace:GetChildren()) do
  77.                 if char.Name == LocalPlayer.Name and char:FindFirstChildWhichIsA("Humanoid") then
  78.                     char.Humanoid.Health = 0
  79.                 end
  80.             end
  81.             LocalPlayer.Character:ClearAllChildren()
  82.             local char = Instance.new("Model", workspace)
  83.             Instance.new("Humanoid", char)
  84.             LocalPlayer.Character = char
  85.             if lastchar ~= nil then
  86.                 lastchar:Destroy()
  87.             end
  88.             repeat runservice.RenderStepped:Wait() until LocalPlayer.Character ~= nil
  89.             lastchar = char
  90.         end)
  91.         repeat runservice.RenderStepped:Wait() until #LocalPlayer:GetChildren() - 3 - currentamount >= toolamount
  92.         renderstepped:Disconnect()
  93.         repeat runservice.RenderStepped:Wait() until LocalPlayer.Character:FindFirstChild("HumanoidRootPart") ~= nil
  94.         lastchar:Destroy()
  95.        
  96.         utilityElements.Tools.Text = "Done respawning?"
  97.         repeat runservice.RenderStepped:Wait() until utilityElements.Tools.Text == "Load Tools"
  98.        
  99.         for _, tool in pairs(LocalPlayer:GetChildren()) do
  100.             if tool:IsA("Tool") then
  101.                 tool.Parent = LocalPlayer.Backpack
  102.             end
  103.         end
  104.         LocalPlayer.Character:FindFirstChild("HumanoidRootPart").CFrame = savepos
  105.         tempchar:Destroy()
  106.     end;
  107.     load = function()
  108.         local b = _player.b()
  109.         local c = _player.c()
  110.         local grip = function(tool, cf)
  111.             local origin = CFrame.new(cf.p)
  112.             local x, y, z = cf:toEulerAnglesXYZ()
  113.             local new = CFrame.Angles(x, y, z)
  114.             local grip = (origin * new):inverse()
  115.             tool.Grip = grip
  116.         end
  117.         local model = c:WaitForChild("gay") -- stupid name choice from what a few months ago?? i have nothing against it i swear
  118.         local parts = {}
  119.         wait(1)
  120.        
  121.         for i, Model in pairs(c:GetChildren()) do
  122.             if Model:IsA("Model") and Model.Name == "gay" then
  123.                 for i, v in pairs(Model:GetDescendants()) do
  124.                     if v:IsA("BasePart") then
  125.                         v.LocalTransparencyModifier = 1
  126.                         if v.Name ~= "Ignore" then
  127.                             table.insert(parts, v)
  128.                         end
  129.                     end
  130.                     if not v:IsA("BasePart") and not v:IsA("JointInstance") and not v:IsA("BodyMover") and not v:isA("Humanoid") and not v:IsA("Model") then
  131.                         v:Remove()
  132.                     end
  133.                 end
  134.                 Model.ChildAdded:Connect(function(c)
  135.                     c.Parent = nil
  136.                 end)
  137.             end
  138.         end
  139.        
  140.         for _, part in pairs(parts) do
  141.             local m = Instance.new("BlockMesh", part)
  142.             m.Scale = Vector3.new(0, 0, 0)
  143.         end
  144.        
  145.         local tools = b:GetChildren()
  146.         for i, tool in pairs(tools) do
  147.             if tool.Parent then
  148.                 wrap(function()
  149.                     tool.Parent = c
  150.                     for i, v in pairs(tool:GetDescendants()) do
  151.                         if v:IsA("Sound") or v:IsA("TouchTransmitter") then
  152.                             v:Destroy()
  153.                         elseif v:IsA("BasePart") then
  154.                             v.Massless = true
  155.                             v.CanCollide = false
  156.                         elseif v:IsA("LocalScript") or v:IsA("Script") then
  157.                             v:Destroy()
  158.                         end
  159.                     end
  160.                    
  161.                     if tool:FindFirstChild("Handle") then
  162.                         local handle = tool.Handle
  163.                         local fakeHandle = handle:Clone()
  164.                         fakeHandle.Name = "FakeHandle"
  165.                         fakeHandle.Parent = tool
  166.                         local w = Instance.new("Weld", handle)
  167.                         w.Part0 = fakeHandle
  168.                         w.Part1 = handle
  169.                         handle.Size = Vector3.new(0, 0, 0)
  170.                     end
  171.                    
  172.                     tool.Parent = b
  173.                 end)
  174.             end
  175.             if (not parts[i]) then
  176.                 tools[i] = nil
  177.                 tool:Destroy()
  178.             end
  179.         end
  180.        
  181.         wait(.2)
  182.         local amt = #tools
  183.        
  184.         wrap(function()
  185.             local connection1
  186.            
  187.             connection1 = game:GetService("RunService").RenderStepped:Connect(function(step)
  188.                 for i = 1, amt do
  189.                     local tool = tools[i]
  190.                     if parts[i] then
  191.                         tool.Parent = b
  192.                         tool.Parent = c
  193.                     end
  194.                 end
  195.                
  196.                 if _player.c() ~= c or c:FindFirstChildWhichIsA("Humanoid").Health == 0 then
  197.                     connection1:Disconnect()
  198.                 end
  199.                
  200.                 utilityElements.Replicate.Text = ("Replicate (%dfps)"):format(1/step)
  201.             end)
  202.         end)
  203.        
  204.         local connection2
  205.         connection2 = game:GetService("RunService").Heartbeat:Connect(function()
  206.             for i = 1, amt do
  207.                 local tool = tools[i]
  208.                 if parts[i] then
  209.                     if parts[i].Transparency ~= 1 then
  210.                         local p = _cframe.toWorldPoint(parts[i].CFrame) * offset
  211.                         grip(tool, p)
  212.                     else
  213.                         local p = _cframe.toWorldPoint(CFrame.new(0, -250, 0))
  214.                         grip(tool, p)
  215.                     end
  216.                 end
  217.             end
  218.             if _player.c() ~= c or c:FindFirstChildWhichIsA("Humanoid").Health == 0 then
  219.                 connection2:Disconnect()
  220.             end
  221.         end)
  222.     end;
  223. }
  224. _cframe = {
  225.     diff = function(a, b)
  226.         return (a:Inverse() * b)
  227.     end;
  228.     toWorldPoint = function(a)
  229.         local arm = _player.c():FindFirstChild('Right Arm') or _player.c():FindFirstChild('RightHand')
  230.         local off = arm.CFrame * gripCenter:Inverse()
  231.         if arm.Name == "RightHand" then
  232.             off = arm.CFrame * CFrame.Angles(math.rad(-90), 0, 0)
  233.         end
  234.         return _cframe.diff(off, a)
  235.     end;
  236.     tween = function(object,style,direction,t,goal)
  237.         local tweenservice = game:GetService("TweenService")
  238.         local tweenInfo = TweenInfo.new(t,Enum.EasingStyle[style],Enum.EasingDirection[direction])
  239.         local tween = tweenservice:Create(object,tweenInfo,goal)
  240.         tween:Play()
  241.         return tween
  242.     end;
  243. }
  244. scriptList = {
  245.     Character = {
  246.         ['Titan']           = {"rbxassetid://3600286284", "rbxassetid://3070358214"};
  247.         ['Winged Titan']    = {"rbxassetid://3593786550", "rbxassetid://3070358214"};
  248.         ['Part Surround']   = {"rbxassetid://3546680077", "rbxassetid://3546673786"};
  249.     },
  250.     Mechanical = {
  251.         ['Spiderbot']       = {"rbxassetid://3040869607", "rbxassetid://3070355648"};
  252.         ['Drone']           = {"rbxassetid://3074236927", "rbxassetid://3074245958"};
  253.         ['Noise']           = {"rbxassetid://3193712297", "rbxassetid://3070358314"};
  254.     },
  255.     Aesthetic = {
  256.         ['Wings']           = {"rbxassetid://3040946714", "rbxassetid://3070358381"};
  257.         ['Tail']            = {"rbxassetid://3041387168", "rbxassetid://3070358314"};
  258.         ['Star Glitcher']   = {"rbxassetid://3074734519", "rbxassetid://3074751071"};
  259.         ['Tentacles']       = {"rbxassetid://3074817074", "rbxassetid://3074820325"};
  260.     },
  261.     Weapon = {
  262.         ['Master Hand']     = {"rbxassetid://3040943596", "rbxassetid://3070358267"};
  263.         ['Ravenger']        = {"rbxassetid://3040945482", "rbxassetid://3070358154"};
  264.     },
  265. }
  266. wrap = function(f)
  267.     return coroutine.wrap(f)()
  268. end
  269.  
  270. if game:GetService("RunService"):IsStudio() then
  271.     guiLib = require(screenGui.GuiLib)
  272. else
  273.     guiLib = loadstring(screenGui.GuiLib.Source)()
  274. end
  275.  
  276. for title, tbl in pairs(scriptList) do
  277.     local frame = pageScripts[title]
  278.     for name, info in pairs(tbl) do
  279.         local btn = interactiveButton:Clone()
  280.         btn.Name = name
  281.         btn.Text = name
  282.         btn.Parent = frame.Elements
  283.         btn.Icon.Image = info[2]
  284.        
  285.         guiLib.circleInteractive(btn)
  286.         guiLib.colorInteractive(btn)
  287.        
  288.         btn.MouseButton1Click:Connect(function()
  289.             local scr = game:GetObjects(info[1])[1]
  290.             local source = scr.Source
  291.            
  292.             if game:GetService("RunService"):IsStudio() == false then
  293.                 for i, v in pairs(scr:GetChildren()) do
  294.                     v.Parent = script
  295.                 end
  296.                 wrap(function()
  297.                     local func = loadstring(source)
  298.                     spawn(func)
  299.                 end)
  300.             else
  301.                 scr.Disabled = true
  302.                 scr.Parent = _player.c()
  303.                 wait(.1)
  304.                 scr.Disabled = false
  305.             end
  306.         end)
  307.     end
  308. end
  309.  
  310. repeat wait() until pageLayout.CurrentPage
  311.  
  312. guiLib.draggable(mainFrame, titleFrame)
  313. for i, v in pairs(toolbar:GetChildren()) do
  314.     if v:IsA("TextButton") then
  315.         guiLib.circleInteractive(v, 2, 1)
  316.         v.MouseButton1Click:Connect(function()
  317.             pageLayout:JumpTo(pages[v.Name])
  318.         end)
  319.         pageLayout.Changed:Connect(function(p)
  320.             if pageLayout.CurrentPage.Name == v.Name then
  321.                 guiLib.tween(v, "Sine", "Out", .5, {BackgroundColor3 = Color3.fromRGB(255, 118, 26)})
  322.             else
  323.                 guiLib.tween(v, "Sine", "Out", .5, {BackgroundColor3 = Color3.fromRGB(236, 109, 17)})
  324.             end
  325.         end)
  326.     end
  327. end
  328.  
  329. for i, v in pairs(utilityElements:GetChildren()) do
  330.     if v:IsA("TextButton") then
  331.         guiLib.circleInteractive(v)
  332.         guiLib.colorInteractive(v)
  333.     end
  334. end
  335.  
  336. utilityElements.Reset.MouseButton1Click:Connect(function()
  337.     local c = _player.c()
  338.     c.Humanoid.Health = 0
  339.     wait(.55)
  340.     for i, v in pairs(c:GetChildren()) do
  341.         if v:IsA("BackpackItem") then
  342.             v.Parent = _player.b()
  343.             v.Parent = _player.p
  344.         end
  345.     end
  346.     repeat wait() until _player.c() ~= c
  347.     _player.c():WaitForChild("Right Arm")
  348.     wait(.25)
  349.     for i, v in pairs(_player.p:GetChildren()) do
  350.         if v:IsA("Tool") then
  351.             v.Parent = _player.b()
  352.         end
  353.     end
  354. end)
  355.  
  356. utilityElements.Block.MouseButton1Click:Connect(function()
  357.     local c = _player.c()
  358.     for _, v in pairs(c:GetChildren()) do
  359.         if v:IsA("BackpackItem") then
  360.             for _, m in pairs(v:GetDescendants()) do
  361.                 if m:IsA("DataModelMesh") then
  362.                     m:Destroy()
  363.                 end
  364.             end
  365.         end
  366.     end
  367. end)
  368.  
  369. local noclip = false
  370. utilityElements.Noclip.MouseButton1Click:Connect(function()
  371.     noclip = not noclip
  372. end)
  373.  
  374. utilityElements.Tools.MouseButton1Click:Connect(function()
  375.     if utilityElements.Tools.Text == "Load Tools" then
  376.         _functions.tools(120)
  377.     else
  378.         utilityElements.Tools.Text = "Load Tools"
  379.     end
  380. end)
  381.  
  382. utilityElements.Replicate.MouseButton1Click:Connect(function()
  383.     _functions.load()
  384. end)
  385.  
  386. local flipped = 0
  387. utilityElements.Flip.MouseButton1Click:Connect(function()
  388.     flipped = (flipped + 1) % 4
  389.     if flipped == 0 then
  390.         offset = CFrame.Angles(0, 0, 0)
  391.     elseif flipped == 1 then
  392.         offset = CFrame.Angles(math.rad(90), 0, 0)
  393.     elseif flipped == 2 then
  394.         offset = CFrame.Angles(0, math.rad(90), 0)
  395.     elseif flipped == 3 then
  396.         offset = CFrame.Angles(0, 0, math.rad(90))
  397.     end
  398. end)
  399.  
  400. game:GetService("RunService").Stepped:Connect(function()
  401.     local c = _player.c()
  402.     if noclip then
  403.         local descendants = c:GetDescendants()
  404.         for i = 1, #descendants do
  405.             local v = descendants[i]
  406.             if v:IsA("BasePart") and v.Name ~= "HumanoidRootPart" then
  407.                 v.CanCollide = false
  408.             end
  409.         end
  410.     end
  411. end)
  412.  
  413. workspace:WaitForChild("S")
Add Comment
Please, Sign In to add comment