How do i make a game where you can pickup stuff?

i dont know how to do this its kind of like fortnite

If you’re asking for help on an inventory system, I would recommend using an array (defined by “[item1, item2, etc.]”.

i want it one at a time

to add an item to an array use array.push(item)

I’d recommend checking out @bluecake’s inventory systems here

about the inventory how the key does work for the chest?

Basically, you wanna check if the inventory contains the corresponding key, and only open the chest if it does contain that key.

Here’s a post on arrays that has also some code for checking if an array contains a certain thing.


iam pretty new to coding and i dont actually no what a array is?

well the post should explain but for some more clarification, an array is basically a list of values. You can make one like this
array1 = [value1,value2,etc.]
For a much deeper look into arrays and javascript in general I recommend w3schools which is a link I posted earlier in the topic