Hello Developers,
I am trying to make a GUI where a player can input a GameId and then when they click a button it will teleport all the players to the selected GameId. Here is my script and examples.
LOCAL SCRIPT IN STARTERGUI WITH A BUTTON AS ITS PARENT
--// SERVICES
local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
--// VARIABLES
local GameId = script.Parent.Parent.Id.GameId.Text
local Value = script.Parent.Value
local PlayerList = Players:GetPlayers()
script.Parent.Activated:Connect(function()
Value.Value = GameId
if Value.Value > 0 then
TeleportService:TeleportPartyAsync(GameId, PlayerList)
end
end)
I am not getting any errors in the console.
Does anyone know how I can fix this?