in mine script, when a player enters the region, the players are added to the list and the countdown starts, when the countdown ends, they are teleported to another place. But I want to leave the option to teleport the players to a PART in the same place, in the workspace, but Do not know how to catch the players within that list and teleport them to that part
does anyone have any ideas?
while true do wait(1)
local list = {}
for i,v in pairs(game.Players:GetPlayers()) do
local char = v.Character
if char then
if checkinregion(char.PrimaryPart.Position) then
table.insert(list,#list+1,v)
end
end
end
if table.getn(list) > 0 then
timer=timer-1
else
timer = starttimer
end
script.Parent.Region.BillboardGui.TextLabel.Text = timer
if timer <= 0 and table.getn(list) > 0 then
so here, the code to move the player inside the list to a part in the workspace <---
--local code = TS:ReserveServer(placeid)
--TS:TeleportToPrivateServer(placeid,code,list)
--for i,v in pairs(list) do
-- ds:SetAsync(v.UserId,code)
--end
wait(2)
end
end