aiden50_70

useless library

May 2nd, 2020
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.45 KB | None | 0 0
  1. -- do not touch anything below this line
  2. -- any changes will most likely break the script as there is a lot of delicate and shitty
  3. --junk code that is probably most likely not needed
  4. -- force of habit, i guess.
  5. function notify(title,text)
  6.     game.StarterGui:SetCore("SendNotification", {
  7.         Title = title or "Notification",
  8.         Text = text or "?",
  9.         Button1 = "Ok"
  10.     })
  11. end
  12. function joinplayer(args)
  13.     function ToServer(User,PlaceId)
  14.         if not pcall(function()
  15.             local FoundUser, UserId = pcall(function()
  16.                 if tonumber(User) then
  17.                     return tonumber(User)
  18.                 end
  19.                
  20.                 return game:GetService("Players"):GetUserIdFromNameAsync(User)
  21.             end)
  22.             if not FoundUser then
  23.                 notify('Join Error','Username/UserID does not exist')
  24.             else
  25.                 notify('Join Player','Loading servers. Hold on a second.')
  26.                 local res = game:HttpGet("https://www.roblox.com/headshot-thumbnail/json?userId="..UserId.."&width=48&height=48")
  27.                 local HttpURL = game:GetService("HttpService"):JSONDecode(res)
  28.                 local ThumbGrab = HttpURL["Url"]
  29.                 local Thumb = ThumbGrab
  30.                 local URL2 = ("https://www.roblox.com/games/getgameinstancesjson?placeId="..PlaceId.."&startindex=")
  31.                 local Http = game:GetService("HttpService"):JSONDecode(game:HttpGet(URL2.."0"))
  32.                 local GUID
  33.                 for i = 0,Http.TotalCollectionSize do
  34.                     local Http = game:GetService("HttpService"):JSONDecode(game:HttpGet(URL2..i))
  35.                     for x,n in pairs(Http.Collection) do
  36.                         for _,v in pairs(n.CurrentPlayers) do
  37.                             if v.Thumbnail.Url == Thumb then
  38.                                 GUID = n.Guid
  39.                             end
  40.                         end
  41.                     end
  42.                 end
  43.                 if GUID ~= nil then
  44.                     notify('Join Player','Joining '..User)
  45.                     game:GetService("TeleportService"):TeleportToPlaceInstance(PlaceId,GUID,game.Players.LocalPlayer)
  46.                 else
  47.                     notify('Join Error','Unable to join user.')
  48.                 end
  49.             end
  50.         end)
  51.         then
  52.             if retries < 3 then
  53.                 retries = retries + 1
  54.                 print('ERROR retrying '..retries..'/3')
  55.                 notify('Join Error','Error while trying to join. Retrying '..retries..'/3.')
  56.                 ToServer(User,PlaceId)
  57.             else
  58.                 notify('Join Error','Error while trying to join.')
  59.             end
  60.         end
  61.     end
  62.     ToServer(args[1],game.PlaceId)
  63. end
  64.  
  65. local function create(classNm)
  66.   local ins = Instance.new(classNm)
  67.   return function(props)
  68.     for prop, val in pairs(props) do
  69.       ins[prop] = val
  70.     end
  71.     return ins
  72.   end
  73. end
  74.  
  75. function createMenuFrame(x1,x2,y1,y2,r,g,b,r2,g2,b2,gui,globalPosition)
  76.     local F = {}
  77.     local FrameMain = Instance.new('Frame',gui)
  78.     FrameMain.Size = UDim2.new(x1,x2,y1,y2)
  79.     FrameMain.BorderSizePixel = 0
  80.     FrameMain.BackgroundColor3 = Color3.fromRGB(r,g,b)
  81.     FrameMain.Position = UDim2.new(0,0,0,0)
  82.     F["Main"] = FrameMain
  83.     local TopBar = Instance.new('Frame',FrameMain)
  84.     TopBar.Size = UDim2.new(1,0,.08,0)
  85.     TopBar.BackgroundColor3 = Color3.fromRGB(r2,g2,b2)
  86.     TopBar.Position = UDim2.new(0,0,0)
  87.     TopBar.BorderSizePixel = 0
  88.     F["TopBar"] = TopBar
  89.     F.SetGlobalPosition = function(Position)
  90.         F["Main"].AnchorPoint = Vector2.new(.5,.5)
  91.         F["Main"].Position = Position
  92.     end
  93.     F.SetGlobalPosition(globalPosition)
  94.     return F
  95. end
  96.  
  97. function modManagementMenu()
  98.     local gui = Instance.new('ScreenGui')
  99.     if is_protosmasher_caller then
  100.         gui.Parent = game.CoreGui
  101.     else
  102.         gui.Parent = game:GetService('Players').LocalPlayer.PlayerGui
  103.     end
  104.     local main = createMenuFrame(0,450,0,350,30,30,30,10,10,10,gui,UDim2.new(.5,0,-1.5,0))
  105.     local label = create("TextLabel"){
  106.         TextColor3 = Color3.new(1,1,1),
  107.         BackgroundTransparency=1,
  108.         Text = "Mod Management Menu",
  109.         Parent = main.TopBar,
  110.         Size = UDim2.new(1,0,1,0),
  111.         TextScaled = true
  112.     }
  113.     local olb = create("TextLabel"){
  114.         TextColor3 = Color3.new(1,1,1),
  115.         BackgroundTransparency=1,
  116.         Text = "bro sorry not done :(",
  117.         Parent = main.Main,
  118.         Size = UDim2.new(1,0,1,0),
  119.         TextScaled = true
  120.     }
  121.     local frame = main.Main
  122.     frame:TweenPosition(UDim2.new(0.5,0,.5,0),"InOut","Sine",1.3)
  123.     wait(3)
  124.     frame:TweenPosition(UDim2.new(0.5,0,-1.5,0),"InOut","Sine",1.3)
  125. end
  126.  
  127. notify("Notification","Useless library loaded, 90% of the functions used here are skidded from IY.")
  128. notify("Notification","This script is using Useless Library, created by Donikthur.")
  129. if not is_protosmasher_caller then
  130.     wait(1)
  131.     notify("Warning","The exploit you are using is not supported. The only supported exploits can be viewed in the Mod Management Menu.")
  132. end
  133. modManagementMenu()
  134.  
  135. local Function = {
  136.     joinplayer = joinplayer,
  137.     notify = notify,
  138.     createMenuFrame = createMenuFrame
  139. }
  140. return Function
Add Comment
Please, Sign In to add comment