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.
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.