TP Gui doesnt work

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Make a gui that teleports players.

  2. What is the issue? It teleports the camera but not character and when you walk it all becomes wierd. https://youtu.be/fnu1t-HWv4Y

  3. What solutions have you tried so far? Changing a few things in the localscript but it resulted in errors and the same issues.

Local Script


local twrpath = game.Workspace.TowerSpawns.Tower1.Position

script.Parent.MouseButton1Click:Connect(function()
	game.Players.LocalPlayer.Character.HumanoidRootPart.Position = twrpath
end)

2 Likes

You shouldn’t use a local script for this if you are trying to teleport the player.

1 Like

Do you mean to use, :SetPrimaryPartCFrame()? Because it moves the whole model from the primarypart:

local twrpath = game.Workspace.TowerSpawns.Tower1.CFrame

script.Parent.MouseButton1Click:Connect(function()
	game.Players.LocalPlayer.Character:SetPrimaryPartCFrame(twrpath)
end)

@xZylter
If I’m not mistaken local scripts can work because clients have network ownership of their character.

Never tried it so maybe it does.

Not sure about what to use i just need to teleport a player using a gui.

Try using :MoveTo(Vector3) on the character model

Alright let me try it. Hope it works.

Is this correct game.Players.LocalPlayer.Character:MoveTo(100,100,100)? sorry im new.

Unable to cast double to Vector3

You must use Vector3.new() to construct a new Vector3

Use CFrame, this gives you the exact position and rotation of the part

local twrpath = game.Workspace.TowerSpawns.Tower1.CFrame

Next, use the :SetPrimaryPartCFrame() function of your rig, this will set the CFrame of your rig while maintaining the joint positions

script.Parent.MouseButton1Click:Connect(function()
   game:GetService("Players").LocalPlayer.Character:SetPrimaryPartCFrame(twrpath)
end
1 Like

I think so but it will be like this or the one that Filtered provide you.

The MoveTo(Vector3) from xZylter worked thanks!

move:to doesnt teleport them, it just moves the character over to a position, and not actually teleporting them.

Model:MoveTo() does do that. You’re thinking of Humnaoid:MoveTo().

1 Like

oh them nvm, i didnt really understand what you were saying but yeah the model does that.