Teleporting to coords dont work like its supposed to

I am trying to achieve a system where you can save coordinates and even teleport to said coordinates. it keeps teleporting to the newest coordinate and not the one you wanted to teleport to.

https://streamable.com/wvtagp

script:

SaveButton.MouseButton1Click:connect(function()
	Item = Placeholder:Clone()
	Item.Parent = Container
	Item.Visible = true

	local Coordinates = game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart", 2).Position

	XAxis = round(Coordinates.X)
	YAxis = round(Coordinates.Y)
	ZAxis = round(Coordinates.Z)

	Item:FindFirstChild("Name").Text = NameBox.Text
	Item.Coords.Text = XAxis..", "..YAxis..", "..ZAxis
	Item.Name = NameBox.Text

	SaveSound:Play()
	
	Item.CopyBut.MouseButton1Click:Connect(function()
		print("wip")
		SaveSound:Play()
	end)

	Item.TeleBut.MouseButton1Click:Connect(function()
		game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart", 2).CFrame = CFrame.new(Coordinates)
	end)
	
end)

Could you show the script so we could actually answer you?

2 Likes

I would be grateful to see the script attached to the actual Teleportation of the player. This will enable us to diagnose your code.

2 Likes

Alright, I added the script for the savebutton.

1 Like

You are attempting to Teleport the Player from the Client? you are also attempting to Clone things from the Client, both of which will not pass the serverside boundary. You have to send a remoteEvent to the server when you actually teleport the Player, and then change their coords on the server. This is due to Filtering Enabled, which is necessary for game security. If players were able to teleport from the client, they could cheat the game much more easily.

1 Like

This is a test build at the moment, and I’ll add that some time soon. The Copy Button is supposed to not clone but do something else. All I really want to do it make it not teleport to the newest item.

This will not work from a LocalScript. It just won’t.