Page 1 of 1

text codes

PostPosted: Wed Sep 19, 2007 2:38 am
by jagheera nex
ok im making a shop in my game and i have it so when you move your curser on the item the shop info actor says how much the item is, and i also got it so when you click on item it goes i your iventory, and where it subtracts that amount, but if you don't have enuph money it still goes in your inventory and the your money amount goes negative, the thing i need to know is how to make it so it doesn't go negative and the shop info actor says somthing like,"you don't have enuph money!"

Re: text codes

PostPosted: Wed Sep 19, 2007 2:50 am
by d-soldier
you need to setup some "if" statements, such as:
on the "buy" event (keydown/mouse button down/etc.)

if (money >= 250)
{
insert your item stuff and money subtraction stuff here;
}
else if (money <= 250)
{
insert your "you don't have enough money for that!" stuff here;
}

Re: text codes

PostPosted: Thu Sep 20, 2007 12:52 am
by Fuzzy
d, that little snippet of code would display both messages if you had exactly 250 money.

Re: text codes

PostPosted: Thu Sep 20, 2007 1:35 am
by jagheera nex
but the thing is idk how to make the "you don' have enuf money" actor :cry:

Re: text codes

PostPosted: Thu Sep 20, 2007 2:48 am
by jagheera nex
and fuzzy what wuld you put?

Re: text codes

PostPosted: Thu Sep 20, 2007 5:58 pm
by d-soldier
Whoops, good catch Fuzzy...

on the "buy" event (keydown/mouse button down/etc.)

if (money >= 250)
{
insert your item stuff and money subtraction stuff here;
}
else if (money <= 249)
{
insert your "you don't have enough money for that!" stuff here;
}