Author Topic: VCE Help - Making a weapon shop?  (Read 2259 times)

Okay, so here is the deal. I want to make an in-base shop for my Laser Tag game. What I want the shop to do is have 2 buttons : One of them with a print of ? That when you click on it, it tells you what the weapon is and does. Of course, I have that down, that part is easy. But the buy button? This is as close as I have gotten:

OnActivate -> Client -> ifVariable -> beamriflebought == 2 (2 is true, 1 is false)
IfVariableTrue -> Player -> addItem -> Beam Rifle
IfVariableFalse -> Self -> Promptclient -> (Yes/No) Do you want to buy this Beam Rifle? (1)
OnPromptAccept -> Self -> ifValue -> <var:cl:score> >= 200
OnVariableFalse -> Client -> CenterPrint -> <color:ffffff>You don't have enough points to buy a Beam rifle...
OnVariableTrue -> Client -> Centerprint -> <color:ffffff>Beam rifle bought! Click on this again to get it.
OnVariableTrue -> Client -> incScore -> -200
OnVariableTrue -> Client -> modVariable -> beamriflebought (Set) 2

What happens is, the first time they click on it and they don't have it, it asks the player : "Do you want to buy this Beam Rifle?" If they choose no, the prompt goes away. But if they choose yes, then it checks the point amount to see if it is above or equal to 200. If that is false, they get a message saying "You dont have enough points to buy a Beam Rifle...". But, if they do have enough points, they get a message saying "Beam rifle bought! Click on this again to get it.". Then their score decreases by 200 and the beamriflebought variable is set to True.


When I tested it, the same thing came out with and without the 200 points - It did the prompt AND said "You dont have enough money to buy this...". The prompt didnt do anything but disappear when I clicked yes, same with no.

What should I do, how can I fix this? Sad Pandah  :panda:

OnActivate -> Client -> ifVariable -> beamriflebought == 1 (1 is true)
IfVariableTrue -> Player -> AddItem -> Beam Rifle
IfVariableFalse -> Self -> Promptclient -> (Yes/No) Do you want to buy this Beam Rifle? (1)
OnPromptAccept -> Self -> ifValue -> <var:pl:score> >= 200
OnVariableFalse -> Client -> CenterPrint -> <color:ffffff>You don't have enough points to buy a Beam rifle...
OnVariableTrue -> Client -> Centerprint -> <color:ffffff>Beam rifle bought! Click on this again to get it.
OnVariableTrue -> Client -> incScore -> -200
OnVariableTrue -> Client -> modVariable -> beamriflebought (Set) 1

Sorry, it didn't work for me.

Are you sure?

Ok one sec


Yeah, I am pretty sure that it did the same thing... Thanks for helping though

Figured yer problem
You have to use an if var on the cl for the score
Here you go.



I dont have the beam rifle so I used the pistol
Same idea.

Bump in case you didn't see this^

Will the prompt still work out if I add it in there?

Will the prompt still work out if I add it in there?
Indeed it will

Okay, I am gonna try it out. Herez a cookie for the meantime  :cookie:


Already done


I just noticed a bug in your thing that I remembered. You cant mod score, you have to use incscore then -200. Well, thats what I think.

Ah, man, dude, its not working. I have 200 points. Its not letting me buy it.  :panda:
Do you notice any bugs? Maybe its because Score is capitalized, maybe it shouldnt be caped.

Goth? You dere? I dont think its working.

I think what's wrong, first of all what you said about the incScore, and also that instead of going to:

client -> VCEifVariable -> <var:cl:Score> >= 200

you should go to:

self -> VCEretroCheck -> playerScore >= 200