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

Doesnt search text after its updated?

local pl = script.Parent.Parent.TextBox.Text




local topkek = script.Parent.Text


script.Parent.MouseButton1Down:connect(function()
    game:GetService('TeleportService'):Teleport(471383497, game.Players[pl])
end)

Problem is before the server starts or before you even click the textbox it says "[Enter name here]" in "pl" but it doesnt check after I change it to a players name how do I do that?

1 comment

0

The code you posted doesnt match anything you just wrote..

1 answer

Explanation:

Your variable local pl = script.Parent.Parent.TextBox.Text saves what you put in before the function ran.

To check it every time you click the button, assign script.Parent.Parent.TextBox to local pl. Then in the function, pl.Text instead of just pl.

Complete Code:

local pl = script.Parent.Parent.TextBox

local topkek = script.Parent.Text

script.Parent.MouseButton1Down:connect(function()
    game:GetService('TeleportService'):Teleport(471383497, game.Players[pl.Text])
end)

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