How do I Teleport All players in the server to another game?

Alright.

I also did a test of my script with not just 1 player, but 8 players on a local test server.

I got the error for not teleporting in studio on all the clients, meaning it did attempt to teleport them all, but that’s not possible in studio itself. That’s why I feel as if theres an issue on your end. TeleportService could be acting up, It never is usually the fasting thing on the planet but it does get the job done.

edit There’s 2 errors cuz I added a yield at the beginning when the server started, then tried to teleport again using the command line in studio, both of which attempted to teleport all clients

1 Like

Have you tried it in a real client? That’s what I’m doing.

If you want me to I can send pics and vids of what I’m doing.

I don’t got enough people for testing in a real client. Studio is basically just the roblox client, only without the actual teleport. If the teleport queue is filling up quick, then something might not be right with the debounce or the way you’re firing to the server

believe it or not, the same player who was already instructed to teleport from a script can be added to the queue again a second time, which is kinda dumb.

1 Like

Do you want me to send pictures and videos?

1 Like

Yes, sending pictures + videos of your process is probably the best way to eliminate this issue.

1 Like

robloxapp-20210709-1556056.wmv (3.2 MB)
Please Watch the video first

Script #1 The Trigger

Script #2 This is in a Gui Btw. This is the Timer

Script #3. This makes the van move.

Script #4 Also in a GUi This is the scrip that makes it fade to black and say “Thanks for playing”

Script #5 The teleport

You’re firing all clients right?

When your local script calls to the server script to teleport a player, just plug that players variable into the function

image

I mean where it says :Connect(function() you put :Connect(function(Player)

That way you can delete the for loop. I think this is what is causing the TeleportService to get bottled. ALL clients in the game are firing that 1 time, which will double the amount of players to actually have. Just get the gameid, then fire that individual player. Since all clients fire the server, they will all be teleported individually without the need of a for loop. Haven’t tested this, but hopefully you get what I mean.

1 Like

I didn’t think of that. Let me try that.

1 Like

I didn’t work but it might be because for some reason my alt can’t get into the van.

This won’t work in Studio, You gotta use it in Roblox Player ( Play game).

1 Like

I have been using Roblox Player.

This is puzzling. I mean, all players should be able to get into the van yes, but if the driver fires a server script to fire all clients, then those clients fire the server to be teleported, it should be working. I haven’t used OnClientEvent() much since I never had to update GUI for other players, but yeah I’m completely puzzled.

What does your console say, if anything?

1 Like

It doesn’t say anything at all. Neither in the client nor the server.

1 Like

Put print() statements everywhere. I know it may be overkill, but that’s all I can recommend at this point. I really thought I had it with the fire client solution but I guess not.

What I mean is, put print() at the start of if statements or the start of scripts just to see if they actually run. For example, put a print() statement where the TeleportService command is. That way, you can see if it’s actually being fired.

1 Like

I’ll try that. Thanks for all the help. And sorry for the trouble.

1 Like

Odd…None of the prints fired…But I know the code is working because it’s doing what it’s supposed to up until the teleport.

If prints don’t work, that’s an obvious issue. Some things fire, because conditions are met. I couldn’t help but notice one line…

if minutes == 0 and seconds == 0 then
-- insert your fire statement here
end

Numbers can weird sometimes, so wouldn’t be surprised if it skipped that if statement, but then again that would be weird because the screen does tween to black and says for playing.

All I can think of now is a bandage fix.

Make a GetPropertyChangedSignal() function that fires when the screen is tweened because you’re probably making a GUI visible, so when the enabled (or visible) property is set to true, this local script will fire to the server, once received, the teleport service will attempt to teleport the player, because you’re firing all clients to tween, so this method should work. I know it sucks, but all I can think of now.

I got really nothing else. It’s either a bug, or something in the script is getting ignored.

1 Like

I’ll do some research on GetPropertyChangedSignal() Because I’ve never used it before. I’ll try what you are suggesting soon but right now, I think I just need a break.
I’ll get back to you once I try that.
Thanks for all the help, and sorry for all the trouble.

1 Like

No worries.

GetPropertyChangedSignal() is simply a function that fires when a property changes. It’s basically like Changed() only for every property known on the platform.

Let’s say you change the text of a text label, and you make a GetPropertyChangedSignal() for it, it will fire because the text property was changed.

So for your case, when you enable the GUI, then make the animation tween to a black screen, if you make a GetPropertyChangedSignal() that watches when you enable the GUI, it will start to fire the player when the screen is tweening (which is quite quick as seen in your video) and teleport service has slight delays, so it should work nicely.

Anyways, I should let others peoples thoughts in. The forum clearly doesn’t like me talking a huge lot lol.

1 Like