Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
Hi, I have an ajax request and the on complete event, with the value returned by te request (Ajax.lastData) I want a condition, if its lower than 3 do one thing, greater another thing. Thank you!
Event 4, instead of gamesPlayed put Ajax.LastData there.
If you get a NaN error, encapsulate the Ajax.LastData with int() i.e. int(Ajax.LastData)
oh that wasnt the right image, I actually have set the variable gamesPlayed to int(score.LastData) but it doesnt work. And for the image test, the text input remains empty.
Develop games in your browser. Powerful, performant & highly capable.
Did you rename the ajax object to "score" ??
if not, rename int(score.LastData) to int(Ajax.LastData)
Just noticed you did.
Check your console for the ajax request response and see if you actually get a value from your request
Yes, I can see the response on the console, but the Ajax on completed event its never fired.
Did you try it without the extra conditions ?
Your response appears to be zero, but the second condition requires it to be higher or equal to 3.