I can't edit the text in a TextBox

I’ve been working on a “check a user’s join date” game, and came across a problem. Could someone please help me?
image This is what’s parented to it…

image This is what it’s parented to.
https://gyazo.com/ae7afb301c5d72516d41ee4acadc40ed
I’m spamming the mouse button and I still can’t type anything, neither can I select the box ;-;

SurfaceGUIs (or just any other sort of interactive GUIs) needs to be in the playerGUI to work.
Place the gui into startergui and set its adornee to the part.

4 Likes

There’s one problem though…
The script doesn’t detect the changes made to the text in the textbox.
image
This is what happens when I print the text. It just says "" and nothing else, and that breaks my script.

What exactly is the script supposed to do?
If I recall correctly, changes to the textbox aren’t picked up by the server as modifications are purely client sided.
In this case why not use a local script parented to starter character scripts.

1 Like

The script can’t be local though, if it would be, I would run into problems…

Yeah okay but why?
What does the script do?
Could you post the script?

Maybe a RemoteEvent would work?

It gets user information using the users API, then it gets the info and changes it so that “Account Age (days): x” gets displayed in one TextLabel and the other TextLabel is for the JoinDate.

local players = game:GetService("Players")

local http = game:GetService("HttpService")

local UName = script.Parent.VUsername

local ID = script.Parent.UserID

local Photo = script.Parent.Photo

local TextBoxes = {script.Parent.Username, script.Parent.Age, script.Parent.JoinDate}

local Confirm = script.Parent.Confirm

wait(5)

Confirm.MouseButton1Click:Connect(function()

print(script.Parent.UsernameTB.Text)

ID.Value = players:GetUserIdFromNameAsync(script.Parent.UsernameTB.Text)

wait()

local Data = http:GetAsync("https://users.rprxy.xyz/v1/users/"..ID.Value)

Data = http:JSONDecode(Data)

Data = Data.created

local createdTime = DateTime.fromIsoDate(Data).UnixTimestamp

local currentTime = DateTime.now().UnixTimestamp

local accountAgeDays = (currentTime - createdTime)/86400

local joinTime = os.time() - (math.floor(accountAgeDays)*86400)

local joinDate = os.date("!*t", joinTime)

joinDate = "Join Date: "..tostring(joinDate.day).."/"..tostring(joinDate.month).."/"..tostring(joinDate.year)

print(joinDate)

Photo.Image = game.Players:GetUserThumbnailAsync(ID.Value,Enum.ThumbnailType.HeadShot,Enum.ThumbnailSize.Size420x420)

TextBoxes[1].Text = UName.Value

print(Data)

print(math.floor(accountAgeDays))

TextBoxes[2].Text = "Account Age: "..math.floor(accountAgeDays).." days."

TextBoxes[3].Text = joinDate

end)

It does some other things too but they don’t really matter in this occasion.

In this case you could just fire a remote event whenever player presses confirm and pass the needed information across to the server (e.g, username).
In future, you should indent your code to make it more readable.

1 Like