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

How do you detect if someone teleported?

Whats the basic idea of detecting if someone teleported his/her character

1 answer

✓ Accepted answer

I am fairly sure that GetPropertyChangedSignal only fires for the HumanoidRootPart position if they have been teleported, so you could try something like this:

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local root = char:WaitForChild("HumanoidRootPart")
		root:GetPropertyChangedSignal("Position"):Connect(function()
			print(plr.Name .. " teleported")
		end)
	end)
end)

However, it is probably a better idea to make a module script with the code that you want to run when a player teleports, and require that module every time a player is teleported in a script.

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