I've got this code in a local script which is in a TextLabel and everytime I test it won't work.
local workspaceassets = game.Workspace:GetChildren()
local replcatedastorageassets = game.ReplicatedStorage:GetChildren()
local serverscriptserviceassets = game.ServerScriptService:GetChildren()
local startguiassets = game.StarterGui:GetChildren()
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
local numberofassets = #workspaceassets + #replcatedastorageassets + #serverscriptserviceassets + #startguiassets
while wait() do
for x = numberofassets,0,-1 do
wait(0.5)
script.Parent.Text = "Loading Assets: "..x
end
script.Parent.Text = "Loaded!"
wait(1)
script.Parent.Visible = false
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
script.Parent.Parent.Parent:Destroy()
end
I hope someone can help.