Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why wont this custom loading screen work?

I'm attempting to create a custom loading screen for my game. Some parts of it wont work, such as text will not change and the time wont either. My game is filtering enabled.

local pgui=game.Players.LocalPlayer:WaitForChild("PlayerGui")
pgui:SetTopbarTransparency(0) -- So no one can see the game in the loading screen

local ui=script.LoadingScreen:Clone()
ui.Parent=pgui -- Putting the gui into the PlayerGui

script.Parent:RemoveDefaultLoadingScreen() -- Removing ROBLOX default loading screen

while game.ContentProvider.RequestQueueSize>0 do -- Attaching to contentprovider
		wait(0.05)
		ui.Frame.Value.Text=game.ContentProvider.RequestQueueSize -- Making the text say how many assets are left to load
end

ui.Frame.Value.Changed:connect(function() -- Fired when all assets are loaded
	if ui.Frame.Value.Text=="0" then
		ui.Frame.Value.Text=" " -- Makes it look neater, instead of saying 0 it says nothing
		script.Parent.Parent.GameLoad.Text="Your game has loaded" -- Informing the player the loading has finished
		wait(1)
		game.Players.LocalPlayer.PlayerGui:SetTopbarTransparency(0.5) -- Making you see through the top bar again
		script.Parent.Parent.Parent:Destroy() -- Removing the gui
		end	
end)

Yes, before anyone asks, I did make this script. The comments are to help anyone who can assist me.

Thanks!

1 answer

✓ Accepted answer

You're trying to index LocalPlayer in a server script?

1 comment

0

It's a LocalScript. Regardless, I got it working now anyway.

This discussion is preserved as it was. New answers, comments, and votes are closed.