Taking the input from a textbox GUI element

So I wish to take the string the player inputs in a textbox GUI element, however it seems that Studio will always take the text that was initially there (Inputted by the developer)

I am completely lost on what to do in order to have the script take the textbox’s updated text.

My code is below if it helps any.

local clickDetector = workspace.BuyThing.ClickDetector
local player = game:GetService("Players").LocalPlayer
game:GetService('Players').LocalPlayer:WaitForChild('PlayerGui')

function onMouseClick()
    player.PlayerGui.Textbox.Enabled = true
end

clickDetector.MouseClick:connect(onMouseClick)

Script works well, but seems to always take the initial text value.

1 Like

You will get the original text if you are using server scripts because the text doesn’t replicate. You can use remote events to send the text from the client to the server

1 Like