Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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.

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 EnzoTDZ_YT 275 — 4y
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 marine5575 359 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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)

0
Thanks so Much!!! marine5575 359 — 4y
Ad

Answer this question