So, I test printed the data and it printed out normally and I tested typeof() and it is a string but it doesn’t update my text for some reason, can someone lmk?
It prints the updated data part but the text doesn’t get updated.
Thanks,
Astraltempus
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local data = require(ReplicatedStorage.SCIData)
local flightinfodata = data["FlightInfo"]
local Flightnum = flightinfodata["Flightnum"]
local Aircraft = flightinfodata["Aircraft"]
local Destination = flightinfodata["Destination"]
local Gate = flightinfodata["Gate"]
local Time = flightinfodata["Time"]
local Status = flightinfodata["Status"]
---------------------------------------------------------------------
local statusui = script.Parent.Status.Text
local timeui = script.Parent.Time.Text
local gateui = script.Parent.Gate.Text
local desui = script.Parent.Destination.Text
local aircraft = script.Parent.Aircraft.Text
local flightnum = script.Parent.Flightnum.Text
---------------------------------------------------------------------
local gui = script.Parent.Parent
while true do
statusui = Status
timeui = Time
gateui = Gate
desui = Destination
aircraft = Aircraft
flightnum = Flightnum
print("updated data")
wait(1)
end
Hi,
I see your are retreiving the text from UI elements (I suppose) and you store them as variables. While this does store the text in your variable and afterwards it updates your variable, you won’t achieve update of the actual text on the element.
To fix this, you will need to change directly the .Text property and not just the variable.
which isn’t actually working, just because you are changing values of variables, not the actual Text.
I also see you are retreving the data from your module script, but you never actually update them in your while loop. I’m not sure if this is intentional, but it really doesn’t seem right to me.
You are just getting the current text of, let’s say Status, and assigning it to statusui as a string variable, then changing that variable.
In conclusion, you HAVE TO use .Text everytime you change the text, you do not want to assign the variable statusui as the Text of Status, but rather set it to the Status Instance then change the text of it.
You are also doing the same mistake with your module, so you should use this instead
local statusui = script.Parent.Status
...
statusui.Text = flightinfodata["Status"]