Invalid list of players for teleport error

  1. What do you want to achieve? I’m trying to make a teleport script, which plays a function on event server fire.

  2. What is the issue? I’m getting this error:

  3. What solutions have you tried so far? I searched Developer forum, but couldn’t find anything.

This is the code:

local teleport = game.ReplicatedStorage:WaitForChild("TeleportPlayer")
local teleportService = game:GetService("TeleportService")
local placeId = 11814731717
local Players = game:GetService("Players")
local playerToTeleport = Players:GetPlayers()[1]

	teleportService:TeleportAsync(placeId, {playerToTeleport})

EDIT: I changed the script a bit, by following Roblox Documentation Guide, but it still gives the same error.

If its asking for a list of Players you may need to Create a Table:

teleport.OnServerEvent:Connect(function(Plr, PlaceId)
	teleportService:Teleport(PlaceId, {Plr})

Make sure PlaceId is a Variable within the RemoteEvent so it can be used to multiple things

Hey so I fixed this by making a local script, and just saying teleportService:Teleport(placeId), which works and fills my requirements/the way I wanted it to work.

So mark the reply above you as solution. That’s literally the answer he gave you

No it’s not? He gave me a complete function which didn’t even work aswell


It’s the exact same thing.

That’s not the exact same thing… The script that xGOA7x edited, was first supposed to be a server script. However, the script which I replied with couple minutes ago, is a local script without the player variable and a function, just the :Teleport() event. Plus I don’t think that it really matters, if you say they are exact same…

The function he gave you is the exact same thing. He put it in the remote event because that’s what he figured you wanted since you tried to do it earlier. He gave you the function, whatever/however you use it doesn’t matter

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.