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

Why is my player not teleporting?

Asked by 8 years ago
game:GetService("TeleportService"):Teleport(425820286, player)

This line of code is in a function, and when the function launches, I get this error for this line: Unable to Cast Value to Object

And yes the id of the place is attached to this start place

player is defined as:

local player

game.Players:PlayerAdded:connect(function(plr)
    player = plr.Name
end

The teleport code works in a while true do loop, but errors me out in the function?

0
How and where is player defined? M39a9am3R 3210 — 8y
0
i updated the script thehybrid576 294 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

This might be a problem. Here is the script.

--This is An example.
local TeleportService = game:GetService("TeleportService")
 --The Local Cannot Be Gone when you are teleporting to another place Like Flood Escape,Etc.
local level1Id = 408502340
--Change These Into Your Place And The Another place that made by Someone else.
local level2Id = 408502380

game.Players.PlayerAdded:connect(function(player)
--If You Did game:GetService("TeleportService"):Teleport(425820286, player)
--It Wont Work.
    TeleportService:Teleport(level1Id, player)
--This Will Help That You Will Teleport Into Another Place.
end)

There Are More Scripts Then game:GetService("TeleportService"):Teleport(425820286, player). If That did not help. Come Talk to me.

Ad

Answer this question