How do you fix text not showing up in TextBox?
Asked by
5 years ago Edited 5 years ago
So I'm making a GUI that shows some cool geeky information like their account age for example. But I've fell into yet another pit. Here's the script:
01 | local plr = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait() |
02 | local char = plr.Character or plr.CharacterAdded:Wait() |
03 | local plrname = char.Name |
04 | local plrageraw = plr.AccountAge / 365 |
05 | local plrid = plr.UserId |
08 | local plragebox = script.Parent.UserAge |
09 | local plridbox = script.Parent.UserID |
10 | local plrsessionbox = script.Parent.UserSessionTime |
14 | local us = "Info has updated" |
15 | local ss = "during this session." |
18 | print ( "User Info updated" ) |
20 | print (us.. " one time " ..ss) |
21 | elseif updated = = 2 then |
22 | print (us.. " two times " ..ss) |
23 | elseif updated = = 3 then |
24 | print (us.. " three times " ..ss) |
25 | elseif updated = = 4 then |
26 | print (us.. " four times " ..ss) |
27 | elseif updated = = 5 then |
28 | print (us.. " five times " ..ss) |
29 | elseif updated = = 6 then |
30 | print (us.. " six times " ..ss) |
31 | elseif updated = = 7 then |
32 | print (us.. " seven times " ..ss) |
33 | elseif updated = = 8 then |
34 | print (us.. " eight times " ..ss) |
35 | elseif updated = = 9 then |
36 | print (us.. " nine times " ..ss) |
37 | elseif updated = = 10 then |
38 | print (us.. " ten times " ..ss) |
39 | elseif updated > 10 then |
40 | print (us.. " " ..updated.. " times " ..ss) |
42 | local plrageraw 1 = plrageraw * 1000 |
43 | local plrageraw 2 = math.ceil(plrageraw 1 ) |
44 | local plragefixed = plrageraw 2 / 1000 |
45 | plragebox.Text = ( "Account Age: " ..plragefixed.. " years" ) |
46 | plridbox.Text = ( "User ID: " ..plrid) |
47 | warn( "User Info will update in 5 minutes" ) |
52 | function PlayerSession() |
66 | plrsessionbox.Text = ( "User Session Time: " ..hr.. "h " ..min.. "m " ..sec.. "s" ) |
Explorer
GUI in-game in Studio
Output
So I can't find out what's wrong with the "Session" part. There's no error in the output and I've looked over it and it appears to be normal. The other two parts of the GUI works just fine. I might be missing something but like I said, it appears to be normal. I am a bit new at coding in Lua. I've tried putting the local variables [sec, min, hr] outside the function, but I expected it not to work and of course, it didn't work.
Thanks in advance! :)