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

Why won't this work?

ID = 132286557

function Teleport(hit)
	game:GetSevice("TeleportService"):Teleport(ID, hit.Parent)
end

script.Parent.Touched:connect(Teleport)

1 comment

0

I tried it in LocalScript. It didn't work. I tried it in Script, it didn't work.

2 answers

local ID = 132286557
function Teleport(player)
	game:service("TeleportService"):Teleport(ID, player)
end

script.Parent.Touched:connect(function(hit)
	find = hit.Parent:FindFirstChild("Humanoid")
	if find then
		plr = game.Players:GetPlayerFromCharacter(hit.Parent)
		if plr then
			Teleport(plr)
		end
	end
end)

-- I rushed that code, let me know if it works. (It should work fine though)

1 comment

0

IT worked.

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