Can I pls get some closure? THE PROBLEM IS IN LINE 10
Here is the script:
local Table = {} local MaxPlayers = 2 local ts = game:GetService("TeleportService") game.Workspace.Pad1.CanTouch = true game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "PLAYERS: 0/2" local inQueue = false script.Parent.Touched:Connect(function(TouchedPart) if TouchedPart.Parent:FindFirstChild("Humanoid") and not inQueue then inQueue = true local Character = TouchedPart.Parent local Player = game.Players:GetPlayerFromCharacter(Character) table.insert(Table,Player) if #Table < 2 then game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "PLAYERS: 1/2" repeat wait(0.01) until #Table > 1 else if #Table > 1 then game.Workspace.TwoPlayerPlayers.Value = 1 game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "PLAYERS: 2/2" wait(2) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING IN: 10" wait(1) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING IN: 9" wait(1) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING IN: 8" wait(1) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING IN: 7" wait(1) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING IN: 6" wait(1) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING IN: 5" wait(1) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING IN: 4" wait(1) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING IN: 3" wait(1) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING IN: 2" wait(1) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING IN: 1" wait(1) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING NOW" wait(2) game.Workspace.TwoPlayerPlayers.Value = 0 game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "PLAYERS: 0/2" Table = {} end end end end)
Try turning it into a table or maybe putting the variable in the function would work
Script:
local Table = {} local MaxPlayers = 2 local ts = game:GetService("TeleportService") game.Workspace.Pad1.CanTouch = true game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "PLAYERS: 0/2" script.Parent.Touched:Connect(function(TouchedPart) local inQueue = false if TouchedPart.Parent:FindFirstChild("Humanoid") and not inQueue then inQueue = true local Character = TouchedPart.Parent local Player = game.Players:GetPlayerFromCharacter(Character) table.insert(Table,Player) if #Table < 2 then game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "PLAYERS: 1/2" repeat wait(0.01) until #Table > 1 else if #Table > 1 then game.Workspace.TwoPlayerPlayers.Value = 1 game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "PLAYERS: 2/2" wait(2) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING IN: 10" wait(1) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING IN: 9" wait(1) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING IN: 8" wait(1) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING IN: 7" wait(1) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING IN: 6" wait(1) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING IN: 5" wait(1) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING IN: 4" wait(1) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING IN: 3" wait(1) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING IN: 2" wait(1) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING IN: 1" wait(1) game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "TELEPORTING NOW" wait(2) game.Workspace.TwoPlayerPlayers.Value = 0 game.Workspace.TWOPLAYERQUEUE.Overhead.BillboardGui.Frame["PLAYERS&TELEPORTING"].Text = "PLAYERS: 0/2" Table = {} end end end end)