Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local UserInputService = game:GetService("UserInputService")
- local LocalPlayer = Players.LocalPlayer
- local lastWaypoint = nil
- -- Create GUI elements
- local screenGui = Instance.new("ScreenGui")
- screenGui.Parent = LocalPlayer:WaitForChild("PlayerGui")
- local frame = Instance.new("Frame")
- frame.Size = UDim2.new(0, 200, 0, 150)
- frame.Position = UDim2.new(1, -210, 0.5, -75)
- frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- frame.Parent = screenGui
- local positionLabel = Instance.new("TextLabel")
- positionLabel.Size = UDim2.new(1, 0, 0.2, 0)
- positionLabel.Position = UDim2.new(0, 0, 0.8, 0)
- positionLabel.Text = "Last Position: N/A"
- positionLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- positionLabel.BackgroundTransparency = 1
- positionLabel.Parent = frame
- -- Set waypoint function
- local function setWaypoint()
- if LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
- lastWaypoint = LocalPlayer.Character.HumanoidRootPart.CFrame
- positionLabel.Text = "Last Position: " .. tostring(lastWaypoint.Position)
- end
- end
- -- Teleport function
- local function teleportToWaypoint()
- if lastWaypoint and LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
- LocalPlayer.Character.HumanoidRootPart.CFrame = lastWaypoint
- end
- end
- -- Key bindings
- UserInputService.InputBegan:Connect(function(input, gameProcessed)
- if gameProcessed then return end
- if input.KeyCode == Enum.KeyCode.G then
- setWaypoint()
- elseif input.KeyCode == Enum.KeyCode.H then
- teleportToWaypoint()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement