Position Save
Key RequiredUniversal

Position Save

Universal ScriptBand23Band23 36 views 81 executesUpdated Jul 9, 2026
Unrated
00
Lua Script•142 lines (3514 chars)
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")

local player = Players.LocalPlayer
local Copy = setclipboard or toclipboard or (Clipboard and Clipboard.set)

local gui = Instance.new("ScreenGui")
gui.Name = "PositionGui"
gui.ResetOnSpawn = false
gui.Parent = game:GetService("CoreGui")

local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, 280, 0, 130)
frame.Position = UDim2.new(0, 20, 0, 20)
frame.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
frame.BorderSizePixel = 0
frame.Parent = gui
Instance.new("UICorner", frame)

local title = Instance.new("TextLabel")
title.Size = UDim2.new(1, 0, 0, 30)
title.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
title.Text = "Position"
title.TextColor3 = Color3.new(1, 1, 1)
title.Font = Enum.Font.SourceSansBold
title.TextSize = 20
title.Parent = frame
Instance.new("UICorner", title)

local coords = Instance.new("TextLabel")
coords.Position = UDim2.new(0, 10, 0, 35)
coords.Size = UDim2.new(1, -20, 0, 55)
coords.BackgroundTransparency = 1
coords.TextColor3 = Color3.new(1, 1, 1)
coords.TextXAlignment = Enum.TextXAlignment.Left
coords.TextYAlignment = Enum.TextYAlignment.Top
coords.Font = Enum.Font.Code
coords.TextSize = 18
coords.Parent = frame

local copy = Instance.new("TextButton")
copy.Size = UDim2.new(0.42, 0, 0, 25)
copy.Position = UDim2.new(0.05, 0, 1, -35)
copy.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
copy.TextColor3 = Color3.new(1, 1, 1)
copy.Font = Enum.Font.SourceSansBold
copy.TextSize = 18
copy.Text = "Copy"
copy.Parent = frame
Instance.new("UICorner", copy)

local close = Instance.new("TextButton")
close.Size = UDim2.new(0.42, 0, 0, 25)
close.Position = UDim2.new(0.53, 0, 1, -35)
close.BackgroundColor3 = Color3.fromRGB(255, 70, 70)
close.TextColor3 = Color3.new(1, 1, 1)
close.Font = Enum.Font.SourceSansBold
close.TextSize = 18
close.Text = "Close"
close.Parent = frame
Instance.new("UICorner", close)

local clipboardText = ""

RunService.RenderStepped:Connect(function()
	local character = player.Character
	if not character then return end

	local root = character:FindFirstChild("HumanoidRootPart")
	if not root then return end

	local pos = root.Position

	coords.Text = string.format(
		"X: %.2f\nY: %.2f\nZ: %.2f",
		pos.X,
		pos.Y,
		pos.Z
	)

	clipboardText = string.format(
		"X: %.2f, Y: %.2f, Z: %.2f",
		pos.X,
		pos.Y,
		pos.Z
	)
end)

copy.MouseButton1Click:Connect(function()
	if Copy then
		Copy(clipboardText)
		copy.Text = "Copied!"
		task.wait(1)
	end
	copy.Text = "Copy"
end)

close.MouseButton1Click:Connect(function()
	gui:Destroy()
end)

local dragging = false
local dragStart
local startPos
local dragInput

local function update(input)
	local delta = input.Position - dragStart
	frame.Position = UDim2.new(
		startPos.X.Scale,
		startPos.X.Offset + delta.X,
		startPos.Y.Scale,
		startPos.Y.Offset + delta.Y
	)
end

title.InputBegan:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		dragging = true
		dragStart = input.Position
		startPos = frame.Position

		input.Changed:Connect(function()
			if input.UserInputState == Enum.UserInputState.End then
				dragging = false
			end
		end)
	end
end)

title.InputChanged:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseMovement then
		dragInput = input
	end
end)

UserInputService.InputChanged:Connect(function(input)
	if dragging and input == dragInput then
		update(input)
	end
end)

Features & Information

useful for making tp to script. shows position of player

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts