need help in how to do flags etc.

Sidrious play Hi! How do flags, varis. etc. works?
Andrew_Baker RTFM!!!

A flag has two states in AGI, set or reset, equivalent to 1 and 0, respectively.

A variable has a value of 0-255. If you go under 0 or over 255, you'll find the var sort of "wrapping around". Like 0 minus 5 will give you something like 250, except it's not very consistent, so you should never rely on this.

Have you actually read the help docs included in AGIStudio? And I mean, ALL of them!!!