# [SOLVED0] How do I Setting for Purchase variable

Get help using Construct 2

### » Wed Sep 14, 2016 12:25 pm

pls check my purchasing system if it is wrong

image
Last edited by luckyrawatlucky on Fri Sep 16, 2016 6:47 am, edited 1 time in total.
B
88
S
48
G
49
Posts: 718
Reputation: 36,038

### » Wed Sep 14, 2016 4:46 pm

So far from what I observed, it seems there are few errors and confusion here....

1. If RandomAdvt is equal/more than 5 you are making it 0
When player dies and if its not the 5th time, RandomAdvt will be 6
That means it will go back to 0

And when the 5th life ends, it will add 1 to RandomAdvt
Error Result = RandomAdvt will always be 0 or 1
Possible solution = Remove Else

2. You have given 2 impossible conditions :
Error Result = Not possible
Possible Solution = Put "or" in the middle

3. I find no reason to make RandomAdvt set to 6 on different places
Cause it will eventually become 0
B
9
S
2
Posts: 77
Reputation: 741

### » Thu Sep 15, 2016 4:45 am

signupdemo wrote:So far from what I observed, it seems there are few errors and confusion here....

1. If RandomAdvt is equal/more than 5 you are making it 0
When player dies and if its not the 5th time, RandomAdvt will be 6
That means it will go back to 0

And when the 5th life ends, it will add 1 to RandomAdvt
Error Result = RandomAdvt will always be 0 or 1
Possible solution = Remove Else

2. You have given 2 impossible conditions :
Error Result = Not possible
Possible Solution = Put "or" in the middle

3. I find no reason to make RandomAdvt set to 6 on different places
Cause it will eventually become 0

oh yes I was just forget to set or condition between both
secondly I have also try
when die =5
trigger once then choose(0,1,2,3,4,5) to RandomAdvt
But first I am going to try putting or between then
if any problem comes
I'll come here

Purpose of RandomAdvt = 6 is
when video finished another video comes again and then again so on
B
88
S
48
G
49
Posts: 718
Reputation: 36,038

### » Thu Sep 15, 2016 10:33 am

I put or in both condition and removed else
but still advt is not showing
only banner is showing which i have set on the startup
B
88
S
48
G
49
Posts: 718
Reputation: 36,038

### » Thu Sep 15, 2016 11:03 am

Whenever you are starting your layout, RandomAdvt is set to be equal to 6.
In the very next event, it is set to be equal to 0.

On start of layout will execute every time you execute/start your layout.
So a "Go to layout" and a "Restart layout" will execute this loop and skip the whole part that checks if RandomAdvt value is between 1 and 5, because it simply never is.
New to Construct ? Where to start

Please attach a capx to any help request or bug report !
Moderator
B
311
S
128
G
101
Posts: 7,416
Reputation: 75,228

### » Thu Sep 15, 2016 11:25 am

I have put a text in the layout to watch
how my die and which RandomAdvt no is trigger
that is working fine
on each die
when die become 5, then RandomAdvt become = 1 and here i have put a restart button
interstitial should come here but nothing happen
i tap restart die become 1 and RandomAdvt = 6 again
B
88
S
48
G
49
Posts: 718
Reputation: 36,038

### » Fri Sep 16, 2016 6:47 am

I have removed last three event 154,155,156
B
88
S
48
G
49
Posts: 718
Reputation: 36,038