yes, I’m an experienced scripter and I still ask basic scripting questions but here I go
I heard that if your code is similar to this:
while true do
print("lol")
end
print("Hey")
The code only keep spamming the lol word, and it will never continue to the rest of the code. Am I missing something? Because if I’m trying to do a retry on getting a player’s DataStore in one thread/script, it would look something like this:
local count = 0
local success, result
success, result = pcall(function()
return DataStore:GetAsync(player.UserId)
end)
if success then
— load data
else
print("DataStore error: "..result)
while not success do
if count <= 5 then
print("Retrying...")
wait(10)
break
success, result = pcall(function()
return DataStore:GetAsync(player.UserId)
end)
count += 1
end
end
Am I doing something wrong? Or am I missing something?
ALSO, ignore the fact that while true loops will cause exhaustion, just imagine while true loops wouldn’t cause this error in this case.