Ameno__GodOH

samodded

Aug 12th, 2024
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.84 KB | None | 0 0
  1. -- LocalScript
  2.  
  3. -- User interface creation
  4. local player = game.Players.LocalPlayer
  5. local character = player.Character
  6. local humanoidRootPart = character and character:FindFirstChild("HumanoidRootPart")
  7.  
  8. -- Check if the character and the "HumanoidRootPart" exist
  9. if not humanoidRootPart then
  10. warn("HumanoidRootPart not found in the character.")
  11. return
  12. end
  13.  
  14. local screenGui = Instance.new("ScreenGui")
  15. local mainFrame = Instance.new("Frame")
  16. local nextButton = Instance.new("TextButton")
  17. local closeButton = Instance.new("TextButton")
  18. local titleLabel = Instance.new("TextLabel")
  19.  
  20. -- Configure the ScreenGui
  21. screenGui.Name = "TeleportGui"
  22. screenGui.Parent = game:WaitForChild("CoreGui")
  23. screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  24.  
  25. -- Configure the main Frame
  26. mainFrame.Name = "MainFrame"
  27. mainFrame.Parent = screenGui
  28. mainFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  29. mainFrame.BorderColor3 = Color3.fromRGB(110, 110, 110)
  30. mainFrame.Position = UDim2.new(0.321, 0, 0.283, 0)
  31. mainFrame.Size = UDim2.new(0, 350, 0, 200)
  32. mainFrame.Active = true
  33. mainFrame.Draggable = true
  34.  
  35. -- Configure the button to advance to the next item
  36. nextButton.Name = "NextButton"
  37. nextButton.Parent = mainFrame
  38. nextButton.BackgroundColor3 = Color3.fromRGB(34, 34, 34)
  39. nextButton.BorderColor3 = Color3.fromRGB(84, 92, 38)
  40. nextButton.Position = UDim2.new(0.1, 0, 0.6, 0)
  41. nextButton.Size = UDim2.new(0, 280, 0, 50)
  42. nextButton.Font = Enum.Font.Gotham
  43. nextButton.Text = "Start Teleport"
  44. nextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  45. nextButton.TextSize = 15
  46.  
  47. -- Configure the close button
  48. closeButton.Name = "CloseButton"
  49. closeButton.Parent = mainFrame
  50. closeButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  51. closeButton.BackgroundTransparency = 1
  52. closeButton.BorderSizePixel = 0
  53. closeButton.Position = UDim2.new(0.85, 0, 0, 0)
  54. closeButton.Size = UDim2.new(0, 40, 0, 40)
  55. closeButton.Font = Enum.Font.GothamBold
  56. closeButton.Text = "X"
  57. closeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  58. closeButton.TextSize = 14
  59.  
  60. -- Configure the label
  61. titleLabel.Name = "TitleLabel"
  62. titleLabel.Parent = mainFrame
  63. titleLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  64. titleLabel.BackgroundTransparency = 1
  65. titleLabel.BorderSizePixel = 0
  66. titleLabel.Position = UDim2.new(0.1, 0, 0, 0)
  67. titleLabel.Size = UDim2.new(0, 200, 0, 40)
  68. titleLabel.Font = Enum.Font.GothamBold
  69. titleLabel.Text = "Teleport through Drops"
  70. titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  71. titleLabel.TextSize = 16
  72.  
  73. -- List of items in the "Drops" folder
  74. local dropsFolder = game.Workspace:FindFirstChild("Drops")
  75. local drops = dropsFolder and dropsFolder:GetChildren() or {}
  76. local currentDropIndex = 1
  77. local teleporting = false
  78.  
  79. -- Function to teleport the player to the current item
  80. local function teleportToCurrentDrop()
  81. if #drops > 0 and currentDropIndex <= #drops then
  82. local drop = drops[currentDropIndex]
  83. if drop:IsA("BasePart") then
  84. humanoidRootPart.CFrame = CFrame.new(drop.Position)
  85. end
  86. end
  87. end
  88.  
  89. -- Function to start automatic teleportation
  90. local function startAutomaticTeleport()
  91. teleporting = true
  92. while teleporting do
  93. teleportToCurrentDrop()
  94. wait(2) -- Wait 2 seconds before moving to the next item
  95. currentDropIndex = currentDropIndex + 1
  96. if currentDropIndex > #drops then
  97. currentDropIndex = 1 -- Return to the first item if finished
  98. end
  99. end
  100. end
  101.  
  102. -- Connect the button to start automatic teleportation
  103. nextButton.MouseButton1Click:Connect(function()
  104. if not teleporting then
  105. startAutomaticTeleport()
  106. end
  107. end)
  108.  
  109. -- Connect the close button
  110. closeButton.MouseButton1Click:Connect(function()
  111. screenGui:Destroy()
  112. teleporting = false
  113. end)
  114.  
  115. -- Teleport to the first item on initialization
  116. teleportToCurrentDrop()
Advertisement
Add Comment
Please, Sign In to add comment