0

# My loading screen doesn't work correctly? Also, what does % do in the second script?

It's pretty simple and I decided to just add Tweening but I get a Userdata error on line 8 of my script. I'd love a well detailed answer

Here's the script:

script.Parent:RemoveDefaultLoadingScreen()

while game.ContentProvider.RequestQueueSize > 0  do

end



My ScreenGui is inside of ReplicatedFirst along with the LocalScript. There's no scripts inside of the ScreenGui! Also in the tutorial I saw a percentage sign "%" and wondered what this does, so if this can also be answered, Thanks.

This is the Wiki's script:

script.Parent:RemoveDefaultLoadingScreen()

local screen = Instance.new("ScreenGui")
screen.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")

local textLabel = Instance.new("TextLabel")
textLabel.Parent = screen
textLabel.Size = UDim2.new(1,0,1,0)
textLabel.FontSize = Enum.FontSize.Size14

local count = 0
while game.ContentProvider.RequestQueueSize > 0  do
count = (count + 1) % 4
wait(.3)
end

screen.Parent = nil

0
The use of the modulus(%) operator here is to only allow 3 dots maximum when displaying the loading text. Lacryma 548 — 7y

1
Redbullusa 1580
7 years ago

You forgot commas after your UDim2 values!

LoadingScreen.Frame:TweenPosition(UDim2.new(0,0, -8,0), "Out", "Linear", 2, true)   -- Line 8


You can't combine two different types of values. A value type that combines UDim2 and EasingDirection Enum value doesn't exist!