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

Teleport to player GUI script not working?

I am trying to make a " Teleport to player GUI " script but it did not work, And this is my script.

script.Parent.MouseButton1Click:connect(function()
	local textbox1 = script.Parent.Parent.FROMPLAYER.Text
	local textbox2 = script.Parent.Parent.TOPLAYER.Text
	local Plr = game.Workspace:FindFirstChild(textbox1)
	local Plr2 = game.Workspace:FindFirstChild(textbox2)
	
	Plr.Torso.CFrame = CFrame.new(Plr2.Torso.Position)
end)

Please edit the script, I really need it.

2 comments

0

Is FE on?

0

No.

1 answer

✓ Accepted answer
    local textbox1 = script.Parent.Parent.FROMPLAYER.Text
    local textbox2 = script.Parent.Parent.TOPLAYER.Text

    local Plr = game.Workspace:FindFirstChild(textbox1)
    local Plr2 = game.Workspace:FindFirstChild(textbox2)

    Plr.Torso.CFrame = CFrame.new(Plr2.Torso.Position)

textbox1 and textbox2 are a TextLabels' text.

In Plr and Plr2 , you're looking for textbox1 and textbox2 or a TextLabels' text.

You're saying textbox1 is the player and you want to teleport to textbox2.

What you should do is get the players' character from game.Players and then get the position.

"Please edit the script, I really need it."

This isn't a request site, but above I told you what you did wrong and it could probably help you.

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