Advertisement
NoTextForSpeech

subplaces test

Apr 20th, 2024
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.89 KB | None | 0 0
  1. game:GetService("StarterGui").ResetPlayerGuiOnSpawn = false
  2.  
  3. local TeleportService = game:GetService("TeleportService")
  4. local UserInputService = game:GetService("UserInputService")
  5.  
  6. local pages = game:GetService("AssetService"):GetGamePlacesAsync()
  7.  
  8. local gui = Instance.new("ScreenGui")
  9. gui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  10.  
  11. local outerFrame = Instance.new("Frame")
  12. outerFrame.Size = UDim2.new(0.5, 0, 0.5, 0)
  13. outerFrame.Position = UDim2.new(0.25, 0, 0.25, 0)
  14. outerFrame.BorderSizePixel = 5
  15. outerFrame.BackgroundColor3 = Color3.new(1, 0.5, 0)
  16. outerFrame.Parent = gui
  17.  
  18. local title = Instance.new("TextLabel")
  19. title.Text = "Teleport To Subplaces By Playvora"
  20. title.Size = UDim2.new(1, 0, 0, 30)
  21. title.TextSize = 15
  22. title.TextColor3 = Color3.new(1, 1, 1)
  23. title.BackgroundColor3 = Color3.new(1, 0.5, 0)
  24. title.Parent = outerFrame
  25.  
  26. local closeButton = Instance.new("TextButton")
  27. closeButton.Text = "X"
  28. closeButton.Size = UDim2.new(0, 30, 0, 30)
  29. closeButton.Position = UDim2.new(1, -30, 0, 0)
  30. closeButton.TextSize = 20
  31. closeButton.TextColor3 = Color3.new(1, 1, 1)
  32. closeButton.BackgroundColor3 = Color3.new(1, 0.5, 0)
  33. closeButton.Parent = title
  34. closeButton.MouseButton1Click:Connect(function()
  35. gui:Destroy()
  36. end)
  37.  
  38. local frame = Instance.new("Frame")
  39. frame.Size = UDim2.new(1, -10, 1, -40)
  40. frame.Position = UDim2.new(0, 5, 0, 35)
  41. frame.BackgroundColor3 = Color3.new(1, 0.5, 0)
  42. frame.Parent = outerFrame
  43.  
  44. local scrollFrame = Instance.new("ScrollingFrame")
  45. scrollFrame.Size = UDim2.new(0.9, 0, 0.9, 0)
  46. scrollFrame.Position = UDim2.new(0.05, 0, 0.05, 0)
  47. scrollFrame.BackgroundColor3 = Color3.new(1, 0.8, 0.4)
  48. scrollFrame.Parent = frame
  49.  
  50. local function updateGUI()
  51. for _, place in pairs(pages:GetCurrentPage()) do
  52. local placeLabel = Instance.new("TextLabel")
  53. placeLabel.Text = "Name: " .. place.Name .. "\nPlaceId: " .. tostring(place.PlaceId)
  54. placeLabel.Size = UDim2.new(1, 0, 0, 30)
  55. placeLabel.Position = UDim2.new(0, 0, 0, (#scrollFrame:GetChildren() + 1) * 30)
  56. placeLabel.TextColor3 = Color3.new(1, 1, 1) -- White text color
  57. placeLabel.BackgroundColor3 = Color3.new(1, 0.5, 0) -- Orange background color
  58. placeLabel.Parent = scrollFrame
  59.  
  60. local teleportButton = Instance.new("TextButton")
  61. teleportButton.Text = "Teleport"
  62. teleportButton.Size = UDim2.new(0.2, 0, 0, 30)
  63. teleportButton.Position = UDim2.new(0.8, 0, 0, 0)
  64. teleportButton.BackgroundColor3 = Color3.new(1, 0.8, 0.4) -- Lighter orange color
  65. teleportButton.TextColor3 = Color3.new(1, 1, 1) -- White text color
  66. teleportButton.Parent = placeLabel
  67. teleportButton.MouseButton1Click:Connect(function()
  68. TeleportService:Teleport(place.PlaceId, game.Players.LocalPlayer)
  69. end)
  70. end
  71. if pages.IsFinished then
  72. return
  73. end
  74. pages:AdvanceToNextPageAsync()
  75. end
  76.  
  77. updateGUI()
  78.  
  79. -- m0veable gui lmao
  80. local dragging
  81. local dragStartPos
  82. local startPos
  83.  
  84. local function updateDrag(input)
  85. local delta = input.Position - dragStartPos
  86. outerFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  87. end
  88.  
  89. outerFrame.InputBegan:Connect(function(input)
  90. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  91. dragging = true
  92. dragStartPos = input.Position
  93. startPos = outerFrame.Position
  94. input.Changed:Connect(function()
  95. if input.UserInputState == Enum.UserInputState.End then
  96. dragging = false
  97. end
  98. end)
  99. end
  100. end)
  101.  
  102. outerFrame.InputChanged:Connect(function(input)
  103. if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
  104. updateDrag(input)
  105. end
  106. end)
  107.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement