Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I need help with teleporting a single player to a different reserved place, Help?

Im trying to make a teleport system that will teleport a single player to a reserved server, I have read the Reserved server and teleporting to a reserved server. They still don't help me. I keep get a 403 http error thanks! Heres My code:

local TS = game:GetService("TeleportService")


local code = TS:ReserveServer(4742624633)
 
 

script.Parent.Touched:connect(function(hit)

	local player = game.Players:GetPlayerFromCharacter(hit.Parent)

	if player then
		TS:TeleportToPrivateServer(4742624633,code,player)

	end

end)

I also get a unable to cast value to object error.

2 comments

0

Remove the part where it says code in the teleportation I don’t think that’s supposed to be their but I don’t work with teleport

0

I Read the Teleport To reserved server and Thats how it reserves a server, by making a code and using the code to teleport to the server

1 answer

✓ Accepted answer

#Problems ##Unable to cast Value to Object There is a simple Cause of this, TeleportService:TeleportToPrivateServer() requires as Argument 3 a Table with Players you want to Teleport. ##HTTP 403 Teleport service doesn't work In Studio. Make sure you are playing in The Roblox Client

Normally you get a Cannot teleport in studio error #Solutions ##Unable to cast Value to Object Simply replace

TS:TeleportToPrivateServer(4742624633,code,player)

with

TS:TeleportToPrivateServer(4742624633,code, {player})

##HTTP 403 Make sure you are playing in Roblox

As i said you normally get a other error. So i'm not sure. #Final Script

local TS = game:GetService("TeleportService")
local code = TS:ReserveServer(4742624633)

script.Parent.Touched:connect(function(hit)
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	
	if player then
	        TS:TeleportToPrivateServer(4742624633,code,player)
	end
end)

1 comment

0

Thanks so Much!!!

This discussion is preserved as it was. New answers, comments, and votes are closed.