Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Me type game Id to teleport people button dosen't work?

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)

1 answer

✓ Accepted answer
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!

This discussion is preserved as it was. New answers, comments, and votes are closed.