Detecting someone's country.

id: 750349

category: Help with Scripts

posts: 5

Skeelix Skeelix loading
I plan on making a large project, but for it to work I need to detect what country the user is viewing the project from, any help this would be greatly appreciated.
homewins homewins loading
There's no easy way to do this. Maybe if you learned how to use ScratchAttach it would be possible, but that's really complicated.
Malicondi Malicondi loading
Only way to do this would be accessing the API and using ScratchAttach or some other library to send the data over to the project, but this would be complicated to code.
ramenecho ramenecho loading

Skeelix wrote:

I plan on making a large project, but for it to work I need to detect what country the user is viewing the project from, any help this would be greatly appreciated.
You could technically do this in regular scratch, it would have to be an honor system though, do something like this in the backdrop sprite
when green flag clicked
Ask [What is your home country?] and wait
set [Location v] to (answer)
deck26 deck26 loading
You can work out their timezone by calculating the hour from ‘days since 2000’ (the fractional part is the fraction of the day in UTC time) with the current hour on their computer. But that is a long way from knowing their country.