I’ve had this problem for a while now, but it wasn’t as slow. So I made a gui to hide the slow teleportation, but now it takes about a minute or two to teleport players. Why is this happening??
Just found out, I get these spammed errors in the client
This isn’t happening to me, at me it is 5-10 seconds. Are you sure your script isn’t including any big yield?
Let me give the script to you…
Script:
– Teleport script
-- Services to use in the code.
local teleportService = game:GetService('TeleportService')
local players = game:GetService('Players')
-- The place you are teleporting the player.
local targetPlace =
script.Parent.Touched:Connect(function(hit)
-- Most of this is from the official dev wiki.
local player = players:GetPlayerFromCharacter(hit.Parent)
-- Making sure the player exists.
if player then
-- Teleporting player
teleportService:Teleport(targetPlace, player)
end
end)
The event Touched may be firing at a rapid pace, reiterating a yielding method. Try disconnecting the connection when you detect the player.
I think I found a fix, but I cannot test it since my game says “Waiting for an available server” even though no one is playing and my game is privated.
I’m pretty sure “Waiting for an available server” refers to waiting for Roblox to open up a server, since as soon as a player joins a game with no servers open, the client has to request the Roblox servers to open a server, which usually takes a bit. (length obviously varies)
True, but I’ve been waiting for a long time and still can’t get in…
Lately me and a lot of other players have been experiencing issues with the Roblox servers, namely connection issues. This is probably something temporary, but it does seem to be quite an issue.
Wait, did your site also crash? Or is it just me.
Adopt me has quite a lot of players today. (A few days ago it just crashed the servers that must be why.) Good thing is that my studio is still open for some reason.
Teleport service depends more on the user connection. You are probably getting those errors for trying to teleport the user again while the teleport is still processing (Basically it keeps trying to teleport them over and over again in a loop when they already getting teleported)
I’ve noticed that you use a touch event, that is why it causes that. Add a debounce to make sure it only teleports them once because as you know the part is being touched over and over again and its firing the teleport service.
Hopefully that fixes your issue!
This worked while in studio, testing it in roblox rn… (I am saying it worked because I added a print function)
Still waiting for an available server ;-;
This is the script you should use:
-- Services to use in the code.
local teleportService = game:GetService('TeleportService')
local players = game:GetService('Players')
The place you are teleporting the player.
local targetPlace =
local Debounce = false
script.Parent.Touched:Connect(function(hit)
-- Most of this is from the official dev wiki.
local player = players:GetPlayerFromCharacter(hit.Parent)
-- Making sure the player exists.
if player and Debounce == false then
-- Teleporting player
Debounce = true
teleportService:Teleport(targetPlace, player)
print("Please wait... Teleporting player!")
else
print("Debounce is true")
wait(6)
Debounce = false
end
end)
That should fix it!
Edit: Fixed an issue, make sure you update the script.
I did this
-- Services to use in the code. local teleportService = game:GetService('TeleportService') local players = game:GetService('Players') -- The place you are teleporting the player. local targetPlace =
local debounce = false
script.Parent.Touched:Connect(function(hit)
if not debounce then
debounce = true
print("Preparing to teleport")
local player = players:GetPlayerFromCharacter(hit.Parent)
if player then
teleportService:Teleport(targetPlace, player)
wait(100)
debounce = false
end
end
end)
I will try your script as well.
I personally believe there is no fix for this, it’s simply Roblox’s TeleportService, being well… TeleportService, it has always been like this, and unreliable, they should invest more time into it since many Roblox games rely on TeleportService.
script.Parent.Touched:Connect(function(hit)
local player = players:GetPlayerFromCharacter(hit.Parent)
if player then
teleportService:Teleport(targetPlace, player)
end
end)
The issue here is that the script is trying to teleport the player repeatedly as they keep touching the part. Which is slowing down the process of the teleportation. But other than that, I think Roblox is currently having issues with creating new servers maybe could be the reason why it’s delaying it even more.
Actually, the Roblox API is lagging right now. Thus resulting the errors in @OP’s post.
Well, it telepored me after 120sec. and then when I got in the place I was trying to get teleported and won, it teleported me to the lobby in 5/8 sec. Odd…
It’s not laggy, but, you could go to Game Settings, Security, and enable third party teleport. i tested it, and it works.
Don’t bump 2 year old topics please, either way this was a roblox issue