Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Teleport to player GUI script not working?

Asked by 6 years ago
Edited 6 years ago

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.

0
Is FE on? Timmerman73 85 — 6y
0
No. SkatePro888899999 5 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago
    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.

Ad

Answer this question