I wanted to make a loading screen but the counter isn’t working and the bar isn’t moving. I don’t know how to make the 2 dots because it apparently shows 3 on devforum. I don’t know how to indent these 2 codes here in devforum, loadingScreen.Background.Counter.Text = "Loading: " … i … “/” …total
ContentProvider:PreloadAsync({v})
Edit: I finally know how to indent the codes, I had to do was use blur this for example I blurred this out, ’ ’ ’ '. I also know how to make it 2 dots, I just had to use Preformatted text with Ctrl + E.
Script starts here
– Credits to a YouTuber, Freakyyy
script.Parent:RemoveDefaultLoadingScreen()
local loadingScreen = script.ScreenGui
loadingScreen.Parent = game.Players.LocalPlayer.PlayerGui
local ContentProvider = game:GetService(“ContentProvider”) local toLoad = workspace:WaitForChild(“RedwoodMap1”):GetDescendants()
The counter isn’t working and the bar isn’t moving. I don’t know how to indent these 2 codes here. loadingScreen.Background.Counter.Text = "Loading: " … i … “/” …total
ContentProvider:PreloadAsync({v})
script.Parent:RemoveDefaultLoadingScreen()
local loadingScreen = script.ScreenGui
loadingScreen.Parent = game.Players.LocalPlayer.PlayerGui
local ContentProvider = game:GetService(“ContentProvider”)
local toLoad = workspace:WaitForChild(“RedwoodMap1”):GetDescendants()
local total = #toLoad
for i,v in pairs(toLoad) do
Preformatted textloadingScreen.Background.Counter.Text = "Loading: " … i … “/” …total
Preformatted textContentProvider:PreloadAsync({v})
end
wait(1)
loadingScreen.Background.Counter.Text = “Done”
wait(1)
loadingScreen:Destroy()
I did have 2 dots in my code but it apparently shows 3 in devfourm, when I edit it’s still 3 dots. Also I’m gonna go to school. My code in Roblox Studio did have 2 dots but it isn’t working.
Are you sure everything loaded in the script? Such as you trying to find the PlayerGui. I recommend waiting for the child, so it doesn’t skip any important things in the script. Please try this code, and see if it works, and always check if the ScreenGui actually has appeared in the PlayerGui, folder, else you have not declared something properly, which may cause this to happen.
script.Parent:RemoveDefaultLoadingScreen()
local plr = game.Players.LocalPlayer
local loadingScreen = script.ScreenGui
loadingScreen.Parent = plr:WaitForChild("PlayerGui")
local ContentProvider = game:GetService(“ContentProvider”)
local toLoad = workspace:WaitForChild(“RedwoodMap1”):GetDescendants()
local total = #toLoad
for i,v in pairs(toLoad) do
loadingScreen.Background.Counter.Text = "Loading: " ..i .. “/” ..total
ContentProvider:PreloadAsync({v})
end
wait(1)
loadingScreen.Background.Counter.Text = “Done”
wait(1)
loadingScreen:Destroy()