Universal Script 📌
23.9k Views
2.3k 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.

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
Script hub
29.8k
92.0k
Bumped 3 hours ago
Key System

Script hub

#2 this week

Verified script badgeArcane Hub | 125+ Games & 4000+ Features

Script hub
138.3k
417.6k
Bumped 3 hours ago
Key System

Script hub

Hall of Fame #6

Verified script badgeAcro Hub | Easy Key System

Script hub
3.9M
964.7k
Bumped 4 hours ago

Script hub

Hall of Fame #3

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

Universal Script 📌
818
150
Bumped 5 hours ago
Key System
Script hub
232
9
Approved 5 hours ago
Key System
Paid
Script hub
3.0M
14.6M
Bumped 7 hours ago

Script hub

Hall of Fame #1

KeylessVerified script badgeYARHM - MM2, FTF, Forsaken, etc.

Script hub
711
135
Approved 7 hours ago
Key System