Universal Script 📌
24.2k Views
2.7k Executions

Save Spot Script

Universal Script 📌
2 years ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

This script allows you to save a position and lets you teleport back to that saved position. The button is draggable.

Updates

  1. Script edited: Create script

View Raw
local player = game.Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = playerGui

local button = Instance.new("TextButton")
button.Size = UDim2.new(0, 200, 0, 50)
button.Position = UDim2.new(0.5, -100, 0.5, -25)
button.Text = "Save Spot"
button.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
button.TextColor3 = Color3.fromRGB(255, 255, 255)
button.Parent = screenGui

local savedPosition = nil

local function savePosition()
    local character = player.Character or player.CharacterAdded:Wait()
    local humanoidRootPart = character:WaitForChild("HumanoidRootPart")

    savedPosition = humanoidRootPart.Position

    button.Text = "Teleport to saved spot"
end

local function teleportToSavedSpot()
    if savedPosition then
        local character = player.Character or player.CharacterAdded:Wait()
        local humanoidRootPart = character:WaitForChild("HumanoidRootPart")

        humanoidRootPart.CFrame = CFrame.new(savedPosition)

        button.Text = "Save Spot"
        savedPosition = nil
    end
end

button.MouseButton1Click:Connect(function()
    if savedPosition then
        teleportToSavedSpot()
    else


Comments

1
Log in to join the conversation. Login
Smorgasbord's profile picture
Smorgasbord2 years ago(edited)

w script very useful

1

Tags

More universal scripts

See all
Universal Script 📌
57.3k
270.0k
Bumped 13 minutes ago
Key System
Script hub
2.2M
2.5M
Bumped 4 hours ago
Key System
Script hub
4.0M
2.7M
Bumped 4 hours ago

Script hub

Hall of Fame #5

KeylessVerified script badge[KEYLESS] Moondiety Script | 30+ supported Games

Script hub
552
2.5k
Bumped 5 hours ago
Script hub
7.8k
70.2k
Bumped 5 hours ago