ServerSideScript:
local function CheckAllPlayersLoaded()
local playersInGame = 0
for _, player in pairs(Players:GetPlayers()) do
if player.CharacterAdded then
playersInGame = playersInGame + 1
print("The player who joined the server is:", player.Name)
if #Players:GetPlayers() == 1 then
print("Player has been loaded in")
task.wait(5)
else
print("Player has not been loaded in")
end
end
end
end
Players.PlayerAdded:Connect(function(player)
CheckAllPlayersLoaded()
if true then
Blur.Enabled = true
task.wait(4.3)
Blur.Enabled = false
end
end)
Local script:
local waitingMessages = {
"Waiting",
"Waiting.",
"Waiting..",
"Waiting...",
"Successfully Loaded!",
}
local function loopWaiting()
for i, v in ipairs(waitingMessages) do
task.wait(0.8)
waitingText.Text = waitingMessages[i]
end
waitingText.Visible = false
end
loopWaiting()
I have these 2 scripts that implement a blur effect and waiting text Label. When a player joins, the blur effect is enabled on the serverside for 4.3 seconds. Then on the client side the waiting Textlabel is enabled and displays each message in the waitingMessages table
Is there a more advanced way to doing this. Because I feel like this depends on the connection of the client. If the client is laggy the blur effect can occur to early for them or too late.
I implemented task.wait() so the timings are correct and the blur effect and GUI disappear at the same time