I want the game I’m working on to have a loading screen when a player joins so that stuff like the lighting works properly. I currently have a TextLabel inside of a ScreenGui in StarterGui which is meant to be the loading screen.
However, when I try and run the game, the text in the TextLabel says “Loading” and never updates. I have print()
statements included in the for loop to see if the code outputs anything, and it outputs exactly what I want, but the actual text that I want to update doesn’t change.
As for trying to solve this problem, I’ve googled the problem and attempted to look for solutions from here on the Developer Forum, to Stack Overflow. Unfortunately this is still not working. I’ve included the code for the loading screen down below, which is a local script that is a child of the TextLabel.
local loadingGui = game.StarterGui.StartingLoad:WaitForChild("TextLabel")
local loadingText = "Loading"
local function loadingScreen()
for i = 1, 4, 1 do
loadingGui.Text = loadingText
print(loadingGui.Text)
wait(0.5)
loadingGui.Text = loadingText .. "."
print(loadingGui.Text)
wait(0.5)
loadingGui.Text = loadingText .. ".."
print(loadingGui.Text)
wait(0.5)
loadingGui.Text = loadingText .. "..."
print(loadingGui.Text)
wait(0.5)
end
-- Below this for loop will be code responsible for fading the loading screen so the player can play the game.
end
loadingScreen()