(☁ var) This article or section uses Cloud Data. Users who are New Scratchers or are using the Offline Editor cannot make projects using Cloud Data or use it in other users' projects. To use Cloud Data, the Scratcher status is needed and the Online Editor has to be used.
Document stub.png This article or section may not have content matching Scratch Wiki editing standards. Please improve it according to Scratch Wiki:Guidelines and Scratch Wiki:Editing Conventions. (March 2022)

This tutorial explains how to check if a user is having problems connecting to Cloud Variables.

Variables needed:

(☁ Debug?)
(Debug?)
(☁ Response)
(Old Response)

Code:

define Cloud variable connection check// Run without screen refresh
if <(☁ Response) = [0]> then
set [☁ Response v] to [1]
set [Old Response v] to (☁ Response)
else
if <(☁ Response) = [1]> then
set [☁ Response v] to [0]
set [Old Response v] to (☁ Response)
end
end
wait [0.5] seconds
if <(☁ Response) = (Old Response)> then
set [Debug? v] to (1)
set [☁ Debug? v] to (1)
end
wait [0.5] seconds
if <(☁ Debug?) = (Debug?)> then
set [Debug? v] to (2)
else
set [Debug? v] to (0)
end
when green flag clicked
set [Debug? v] to (0)
forever
if <<(Debug?) = [0]> and <(☁ Debug?) = [1]>> then
set [☁ Debug? v] to (0)
end
end
when green flag clicked
hide
forever
Cloud variable connection check
if <(Debug?) = [2]> then
show
say [Connection error or there are no other players on.]//This notifies you that there are no other players on or your connection isn't working.
else
hide
end
end
Cookies help us deliver our services. By using our services, you agree to our use of cookies.