Place teleport script (Script)
while true do
wait(0.1)
local Part = script.Parent
local CD = Part.ClickDetector
local GameId = script.Parent.Value.Value
CD.MouseClick:connect(function(Player)
game:GetService('TeleportService'):Teleport(GameId, Player)
end)
end
So I am trying to use a textbox change the value, and that works. But the script doesn't change it it says: Cannot teleport to a place that doesn't exist (place id 0)
Button script (Local Script)
function thingy()
print("Loading script")
local mess2 = game.Workspace.newestad.Part2.SurfaceGui.id
local l = script.Parent.Parent.TextBox
print("Changing text 2.")
mess2.Text = (""..l.Text)
print("Done.")
game.Workspace.test.Clickable.Value.Value = script.Parent.Parent.TextBox.Text
end
script.Parent.MouseButton1Click:Connect(thingy)

3 comments
(Almost) All changes that the client makes will not be replicated to the server which means that while the value has changed on the client it has NOT changed on the server. In order for you to do this you will need to use a remote event/function and send that change to the server so that it knows.
Also you don't have to constantly connect to the MouseClick event for the ClickDetector so you can remove the while loop and the wait :)
Okay I am gonna try.