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

Why is TeleportService Not Working?

I am currently trying to teleport my avatar into another place attached to my game. Here is the code I used for my Teleportation pad.

local TpService = game:GetService("TeleportService")

script.Parent.Touched:Connect(function(hit)
	local human = hit.Parent:FindFirstChild("Humanoid")
	if human ~= nil then
		local GuyWhoTouched = game.Players:GetPlayerFromCharacter(hit.Parent)
		TpService:Teleport(5616919371,GuyWhoTouched)
	end
end)

However, when I play the game and touch the part, the screen simply freezes, and the program stops responding. The code is in a server script, and the script's parent is the teleporter. I tested this on a live server instead of Studio, and both places are set to private. Is there something wrong with the script?

1 answer

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