I am lost right now. So currently I am trying to make a GUI where It'll teleport the player to a specific part when the player enters a specific number. (e.g 1, 2, 3, 4)
How would I go about this?
local Textbox = script.Parent
local Player = game:GetService("Players").LocalPlayer
local Stage = game.Workspace:WaitForChild("Stages")
local HumanoidRootPart = Player:FindFirstChildOfClass("HumanoidRootPart")
Textbox.FocusLost:Connect(function(enterPressed)
if enterPressed then
for i, stages in pairs(Stage:GetChildren()) do
if stages:IsA("BasePart") then
local NumberText = tonumber(Textbox.Text)
local StageNumber = tonumber(stages.Name)
if NumberText == StageNumber then
-- Teleport player or something
end
end
end
end
end)

2 comments
are you trying to find out how to teleprt them
Yes.