script.Parent:RemoveDefaultLoadingScreen()
local event = game.ReplicatedStorage:WaitForChild("Loading")
local otherevent = game.ReplicatedStorage:WaitForChild("Loading2")
local client = game.Players.LocalPlayer.PlayerScripts:WaitForChild("LoadingScript")
local Camera = workspace.CurrentCamera
local cams = script.Cameras
local gui = script.ScreenGui
local plr = game.Players.LocalPlayer
local number = 0
cams.Parent = game.Workspace
number = 20
event:Fire(number)
wait(2)
repeat wait()
Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
Camera.CFrame = cams.One.CFrame
gui.Parent = plr.PlayerGui
local TextLabel = gui.Frame.TextLabel
while wait(0.01) do
if TextLabel.TextTransparency > 0.05 then
TextLabel.TextTransparency -= 0.05
else
print("Done")
end
end
repeat wait()
repeat wait()
gui.Frame.TextLabel.TextTransparency = gui.Frame.TextLabel.TextTransparency + 0.05
wait(0.01)
until gui.Frame.TextLabel.TextTransparency == 1
wait(2)
repeat wait()
gui.Frame.TextLabel.TextTransparency = gui.Frame.TextLabel.TextTransparency - 0.05
wait(0.01)
until gui.Frame.TextLabel.TextTransparency == 0.05
wait(2)
until game:IsLoaded()
gui:Destroy()
script:Destroy()
I’m making a loading screen, the events are for making the screen blur (it is sent to another local script inside the player scripts.)
Here’s your answer. Decimals round weirdly and they won’t ever exactly equal 0.05. Use an inequality operator such as until gui.Frame.TextLabel.TextTransparency <= 0.05
If you’ve got a condition that’s supposed to end the loop, put it in the condition section of the loop and it will fix all the other problems you guys have been having down the thread.
I know this post had been solved but i would like to suggest using TweenService for this case
local TextLabel = gui.Frame.TextLabel
local TweenService = game:GetService("TweenService")
local TweeningInfo = TweenInfo.new(0.5) -- How much time the tween should be
local goal = {}
goal.TextTransparency = 0.05
local Tween = TweenService:Create(TextLabel,TweeningInfo,goal)
Tween:Play()
TweenService didn’t always exist and in most scenarios outside of Roblox it doesn’t. Loops are made for this and I’d argue it’s simpler and less overhead to just make a loop. It’s certainly not a weird bypass. It’s just how programming works.