Hope This Helped!
Script -
-- Place this script inside the TextButton
local textButton = script.Parent
local part1 = game.Workspace:WaitForChild("Part1")
textButton.MouseButton1Click:Connect(function()
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
-- Calculate the new position 3 studs above part1
local newPosition = part1.Position + Vector3.new(0, 3, 0)
-- Teleport the player
humanoidRootPart.CFrame = CFrame.new(newPosition)
end)
#roblox #robloxstudioscripting #tutorial #robloxstudio