Teleporting a table of players to a private server

Ok I was wondering because there are no errors but it seems to not print that I joined the room like I put in the function and it isnt teleporting me.

Where are you calling the JoinRoom remote event?

What do you mean? Like where do I have the function located?

Where did you put that piece of code?

That is in the join room button

Can I see exactly what you have there?

oh my gosh i made a mistake in it haha, I added 2 mouseButtonDown functions lol, I fixed it. Then now inside of the ServerScriptService code I am getting a constant error of “Unable to cast value to Object”

Maybe try to change that to this:

game.ReplicatedStorage.JoinRoom.OnServerEvent:Connect(function(player,roomName)
    local newPlayers = {}
    for _, v in ipairs(rooms[roomName].players)
        table.insert(newPlayers, v)
    end
    rooms[roomName].players =  newPlayers
	print(player.Name.." joined "..roomName..".")
end)

Also is that function where the error was happening

The “Unable to cast value to object” error is happening when on the line that says “warn(result)”

Try to print the playerList right before that warn line

this is very odd, after redoing the code you just recently gave the error stopped happening and now the problem is again it wont teleport me, but my name is printing properly now.

Note as it mentioned in the dev hub article this

WILL NOT

teleport in studio

Yes I know that, I’ve published the place and have been testing there a minute ago and it still isnt teleporting me.

Alright, and there are no errors?

Yes there are no errors anymore.

Can you screen shot what the playerList prints out before we try to teleport

The only thing that is being printed or said in output in general is just " 15:47:22.350 ShadowDinoYT joined Room1. - Server - Teleport:41"

(I can resend the server script service Script if needed)

Did you add print(playerList) before the return statement here.

I didnt, but I just added it and still no error and the same thing is printing.

Well at this point I think the easiest way for me to help you is if you send me a model of your current setup