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

This script wont teleport the character to the parts position, can you help?

clk.MouseClick:Connect(function(player)
	print("Teleporting...")
	script.Parent.ClickDetector.MaxActivationDistance = 0
	game.Workspace.Sounds.Confirm2:Play()
	game.Players.PlayerAdded:connect(function(player)
		player.CharacterAdded:connect(function(character)
			character:MoveTo(script.Parent.Parent.TP.Position)
		end)
	end)
	print("Teleported!")
	wait(2)
	script.Parent.ClickDetector.MaxActivationDistance = 6
end)

It doesn't teleport the character.

1 answer

✓ Accepted answer
clk.MouseClick:Connect(function(player)
    print("Teleporting...")
    script.Parent.ClickDetector.MaxActivationDistance = 0
    game.Workspace.Sounds.Confirm2:Play()
	local Char = player.Character or player.CharacterAdded:Wait()
	Char.HumanoidRootPart.CFrame = script.Parent.Parent.TP.CFrame
    print("Teleported!")
    wait(2)
    script.Parent.ClickDetector.MaxActivationDistance = 6
end)

Try this

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