Not removing child!

Hello friends!
Isn’t this code suposed to remove the child of my variable?
It keeps repeating the random numbers.

check the debugger to see whats going in your structure.
your events will remove
random from

In debugger when the random variable changes it shows it between quotes i.e.: “7” and remove the child, when a number repeats, it’s shown whitout quotes, i.e: 7 and it looks faded, and nothing else changes.

Another issue:
I have 2 object text on my scene. pontuacao and pontuacao_num.
The action: change the text of: pontuacao, returns the variable “random” but if I change
the action to: change the text of: pontuacao_num, it does nothing. Text keeps showing 0.

what do you expect to happen?
if the child doesnt exist anymore after beeing rolled, the number is just a number, because you set text to random event is a subevent of child exist.

to your second problem. you have some conflicting events. the screenshot by itself will work perfectly.

I expect to random another number if the child doesn’t exist. I need to put another condition if child exists and inverse it, right?
I tried a lot of things but doesn’t work.

For the second problem, maybe because I set the pontuacao_num as global?

you get another random number each time you click.
if you want to see your random number, just change a text to it, without condition.

if you want to reroll each time you get a number that doesnt exist, so you always remove a child on click, you need a while loop.
i expect the array variables to be available with the next update, so maybe you should wait for that, since arrays would make this specific procedure youre trying to archive alot easier and better.
but as of now you can archieve this by doing this:

no, global object or not, doesnt matter, whatsoever.

Thanks again Slash. I didn’t know the existence of this function “VariableChildCount”.
It worked great!

Now I’m gonna try to find what’s causing my second problem.
Thanks so much.