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

Why is my player not teleporting?

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?

2 comments

0

How and where is player defined?

0

i updated the script

1 answer

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.

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