I don't know why it don't work
local GameIDType = game.StarterGui.ScreenGui.Frame.TextBox.Text
local TextButton = game.StarterGui.ScreenGui.Frame.TextButton
local TeleportService = game:GetService("TeleportService")
TextButton.MouseButton1Click:Connect(function(player)
TeleportService:Teleport(GameIDType, player)
end)
local GameIDType = game.StarterGui.ScreenGui.Frame.TextBox local gamevalue = Instance.new("NumberValue") gamevalue.Parent = game.StarterGui.ScreenGui.Frame gamevalue.Value = GameIDType.Text local TextButton = game.StarterGui.ScreenGui.Frame.TextButton local TeleportService = game:GetService("TeleportService") TextButton.MouseButton1Click:Connect(function(player) TeleportService:Teleport(gamevalue, player) end)
Hope this works!
Doesn't work because:
You can't have a propety that is a string or a number for some objects that in a variable. For example: "example.Value", Instead, Write "example", and at another line the example's variable to add ".Value"
Hope this helps for your future projects!