Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i make a loading screen with a progress bar?

Asked by 1 year ago
Edited 1 year ago

i tried to make a progress bar with this script: -- Variables. local frame = script.Parent.Frame local bar = frame.Bar local inside = bar.Inside

local player = game.Players.LocalPlayer

-- Functions. local function ResizeBar(percent) inside:TweenSize(UDim2.new(percent/100, 0, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 1, true) wait(1) end

-- Start loading. game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.All, false)

frame.Visible = true

-- Resize to 10%. ResizeBar(10)

-- Wait for the character to load. repeat wait() until player.Character ~= nil ResizeBar(40)

-- Load in assets. game:GetService("ContentProvider"):PreloadAsync({workspace, player.PlayerGui}) ResizeBar(100)

-- Hide screen. frame.TextLabel.Text = "LOADED!" wait(1)

game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.All, true) script.Parent:Destroy()

Bar = progress bar. Inside = the progress OF the bar. frame = the screen itself.

1 answer

Log in to vote
0
Answered by 1 year ago

just remove the "--" ig??

Ad

Answer this question