Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Create the ScreenGui
- local screenGui = Instance.new("ScreenGui")
- screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- -- Create the first button
- local button1 = Instance.new("TextButton")
- button1.Size = UDim2.new(0, 200, 0, 50)
- button1.Position = UDim2.new(0.5, -100, 0.5, -75)
- button1.Text = "Teleport to First Location"
- button1.Parent = screenGui
- -- Create the second button
- local button2 = Instance.new("TextButton")
- button2.Size = UDim2.new(0, 200, 0, 50)
- button2.Position = UDim2.new(0.5, -100, 0.5, 25)
- button2.Text = "Teleport to Second Location"
- button2.Parent = screenGui
- -- Function to teleport the player to the specified coordinates
- local function teleportToLocation(position)
- game.Players.LocalPlayer.Character:MoveTo(position)
- end
- -- Button 1 click event
- button1.MouseButton1Click:Connect(function()
- local position1 = Vector3.new(-246.390869140625, 18.79619598388672, -51.302978515625)
- teleportToLocation(position1)
- end)
- -- Button 2 click event
- button2.MouseButton1Click:Connect(function()
- local position2 = Vector3.new(320.1489562988281, 19.332275390625, -50.58977127075195)
- teleportToLocation(position2)
- end)
Add Comment
Please, Sign In to add comment