I want to teleport the players that are in my Table. I was trying to insert the player from a stringvalue to
the table. But when I try to teleport its showing me an error in the Console
I have tried many different ways to make it work but it didn’t.
local Member = {}
print(player.Name)
local children = game.ReplicatedStorage:FindFirstChild(player.Name…"'s GroupRequests").StringValues:GetChildren()
for i = 1, #children do
table.insert(Member,children[i])
end
print(unpack(Member))
TeleportService:TeleportToPrivateServer(
Place,
TeleportService:ReserveServer(Place),
Member)
end)
local players = {}
for _, player in next, game.ReplicatedStorage["Anton00k's GroupRequests"].StringValues:GetChildren() do
if not table.find(players, player.Name) then
table.insert(players, player.Name)
end
end
note:
in that folder should be Any Values with players name
thanks for corecting me, so this will be the script:
for _, player in next, game.ReplicatedStorage["Anton00k's GroupRequests"].StringValues:GetChildren() do
if not table.find(players, player.Name) then
table.insert(players, player.Value, tonumber(_))
end
end
I made another edit to my code, so you can see how to correctly make it. Also, it’s not necessary to specify table.insert’s third argument because by default, it puts the value in the next index of the table, which would be #Table + 1