Teleport Command Help

Right, so I made a simple teleport command. Now I need help making a Bring command.

Teleport Command Code
script.Parent.MouseButton1Click:Connect(function()
	if game.Players:FindFirstChild(script.Parent.Parent.Parent.upper.Target.Text) then
		game.ReplicatedStorage.BringPlayer:FireServer(script.Parent.Parent.Parent.upper.Target.Text)
	else
		script.Parent.Parent.Parent.upper.failed.TextTransparency = 0
		wait(3.5)
		script.Parent.Parent.Parent.upper.failed.TextTransparency = 1
	end
end)

Here’s the main script.

game.ReplicatedStorage.BringPlayer.OnServerEvent:Connect(function(plr,name)
	plr.Character.HumanoidRootPart.CFrame = game.Players:FindFirstChild(plr).Character.Head.CFrame
end)

I know the bring script would be really similar to the teleport script, I just can’t piece it together. Any help would be great.

What do you mean by “Bring” command?

replace this with name

game.ReplicatedStorage.BringPlayer.OnServerEvent:Connect(function(plr,name)
	plr.Character.HumanoidRootPart.CFrame = game.Players:FindFirstChild(name).Character.Head.CFrame
end)

Like whatever player username you say in the textbox teleports them to you when you push the UI button
f725e24ed47289ab3df6bf0b9284527c

All that did was the same thing as the original TP command.

Not exactly sure what this is?

Oh I named the frame that for the UI, cuz for the GUI I separated the parts in between upper and lower. The textbox where you say the players username is in the upper part of the UI.

Oh wait, switch the two around.

game.ReplicatedStorage.BringPlayer.OnServerEvent:Connect(function(plr,name)
	 game.Players:FindFirstChild(name).Character.HumanoidRootPart.CFrame = plr.Character.Head.CFrame
end)

You may not want to have the target CFrame for the head

game.ReplicatedStorage.BringPlayer.OnServerEvent:Connect(function(plr, name)
    game.Players:FindFirstChild(name).Character.HumanoidRootPart.CFrame = plr.Character.HumanoidRootPart.CFrame
end)

Aight, thanks to the both of you for your help :slight_smile:

You’re welcome!

CharacterLimits :rage:

1 Like