Hello! I'm making a game. First - I create a place using the script. (this is, by the way, in a TextButton) Next, I attempt to teleport them. THAT'S where the problem begins. Any ideas?
function onClick() game:GetService("AssetService"):CreatePlaceAsync("Turismo", 124352923, "no") game:GetService("TeleportService"):Teleport(124352923, game.Players:GetChildren()) end script.Parent.MouseButton1Click:connect(onClick)
function onClick() game:GetService("AssetService"):CreatePlaceAsync("Turismo", 124352923, "no") game:GetService("TeleportService"):Teleport(124352923, game.Players:GetChildren()) end script.Parent.MouseButton1Click:connect(onClick)
Your problem is in the 3rd line.
Your getting a table of the children in players. You want to get a specific player. Put this code into a localscript.
function onClick() game:GetService("AssetService"):CreatePlaceAsync("Turismo", 124352923, "no") game:GetService("TeleportService"):Teleport(124352923, game.Players.LocalPlayer) end script.Parent.MouseButton1Click:connect(onClick)
Now im not sure if youre trying to teleport all the players in the server. (since you used :GetChildren())
Heres a guide on teleport service
Comment below if i helped!