I’m trying to create an if statement that checks to see how many items a player owns. The items are stored as booleans and I need to convert the amount of items owned to an int so I can check to see how many the player owns in order to run the next part of my script.
buy is where the booleans are created and stored, and owned is the bool. I need to check if the player has 1 or more items. I can’t change the bool to an int on the other script. It has to stay a bool.
I tried creating an int value on this script that converts the numbers of booleans the player has into an int and then using that to carry out the if statement.
public int houses;
public static int ToInt32(
bool houses
)
buy.owned = houses;
Hmm… I’ve not used Lists before. I’ll look into it. Any suggestions on how to implement it?
I did play with using an array but it’s one script that is attached to all of the items to an array would be added to every time owned becomes true and I couldn’t do that.