HowToRoblox

TeleportGuiHandler

Nov 29th, 2021
964
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local btn = script.Parent:WaitForChild("TeleportButton")
  2. local gui = script.Parent:WaitForChild("TeleportFrame")
  3.  
  4. gui.Visible = false
  5.  
  6.  
  7. btn.MouseButton1Click:Connect(function()
  8.     gui.Visible = not gui.Visible
  9. end)
  10.  
  11.  
  12. local mps = game:GetService("MarketplaceService")
  13.  
  14. local ids = {8096387623, 8072420740, 8042312874, 7977021348}
  15.  
  16.  
  17. for i, id in pairs(ids) do
  18.    
  19.     local gameInfoGui = script:WaitForChild("GameInfoTemplate"):Clone()
  20.    
  21.     local gameInfo = mps:GetProductInfo(id)
  22.    
  23.     gameInfoGui.GameTitle.Text = gameInfo.Name
  24.     gameInfoGui.GameIcon.Image = "https://assetgame.roblox.com/Game/Tools/ThumbnailAsset.ashx?aid=" .. id .. "&fmt=png&wd=420&ht=420"--"rbxassetid://" .. gameInfo.IconImageAssetId
  25.    
  26.     gameInfoGui.JoinButton.MouseButton1Click:Connect(function()
  27.        
  28.         game.ReplicatedStorage:WaitForChild("TeleportSystemRE"):FireServer(id)
  29.     end)
  30.    
  31.     gameInfoGui.Parent = gui.GamesScroller
  32.    
  33.     gui.GamesScroller.CanvasSize = UDim2.new(0, gui.GamesScroller.UIListLayout.AbsoluteContentSize.X, 0, 0)
  34. end
RAW Paste Data