 Now that we have some assets that players can use let's see how they can interact with these assets so they can Actually use them. So in this video, we are going to see how we can mainly give assets to players and How we can retrieve the players inventory data so that we can display the assets that players have In the actual game. So you can see that we have now an inventory that players can interact with so that can they can access They the assets so let's get started So here we are on the loot lockers dashboard and as we know the first thing that we are going to do is to select our game To get access to the players inventory We go to players the player option here on the left side of the screen And we are going to have a list of all the players that we have available can see that I have manual here that was basically just test players and a small tip here if you want to make a Dummy player so that you can test some stuff you can actually change the Authentication changing the key that you are passing at the players identifier key on the request body So for instance, I have this one here, but you can give whatever name you want Just just make sure that it is a string and you have some control over this player This can be something like dummy. Let's use dummy for this video. So I will log in Logging successful. Let's go back to our dashboard I will refresh this page and you can see that there we have the dummy player. Let's view this So you can see that there are no items for this dummy player. Let's go back to the game You can see that we are going you are trying to retrieve some assets from the dummy inventory But we have none. Let's go back to the main page. Let's give them some asset So the way that you can manually give assets to players is just by clicking on this give asset button here and Select which asset you want to give to this player. So let's say this our mouse and If we go back to the game, I would go to the skins here And there we have it. We have the skin the our mouse skin here And this is how we manually give assets to a player. So let's say we receive a payment through PayPal For instance, if we have a small amount of players and we want to to give them some asset This is how you do that But as we we are going to see in the next video about triggers there is ways to automate this process Don't don't be worried. You don't have to do this manually. So let's see now how this works on the gutter side How good I'll pick up this Disinformation this data and recreate the asset on the players on the client side on the player side of this Relationship, but first of all, let's see the API that we are going to need to use in order to retrieve this data So let's go there. So here I am on the lootlockers API and to get the players inventory is quite simple We just have to make an HP request to this URL using the get method And we are going to get as a response from the server a JSON file with two keys so a success key if we successfully retrieve the players inventory and An inventory key which is an array in which each element is a dictionary with all the asset information with all the asset data So we can see that here. We have the asset key So let's see how we can use this information how we can use this data and process it in got engine So this is the same scene that we used in the previous video But now we are going to enter into the inventory school container script. So let's open that and you can see that I already have this load skins method which basically does the same thing that the previous one does But with some difference for instance, we have the the a different URL You can see that I'm using the the one that we just saw in the API So player slash inventory slash list on the heater We are making sure that we are using the X session token that we can access through the looklocker single term a get method and making a request using the URL header Foss because we don't want SSL certification and the method that we just set Then we use for the response and convert it parse it from a json file so that it converts into a dictionary and Then we run through each asset in the response that we just saw that is an array, right? So each element of the array is an asset data then for each one of this asset We access the asset key that we just saw that it's one of the keys from this dictionary It sounds a bit confusing. I could use other names here But let's stick to it and then on the asset on the asset key, which is a dictionary as well We have the files key that have that give us asset access to the files that we uploaded Remember on the previous video that to create a an asset We upload some files using the looklocker's dashboard. This is the URL that these files are hosted So we access the the scene URL because we uploaded a scene file and this scene file is not on the player's version of the game to prevent them from making weird stuff with this file and We are going to host it on the looklocker server and we're using this to retrieve this asset Retrieve this file from the looklocker server and recreate this on the player's side on the player's machine So to do that we need to know Which is the URL that this file is hosting then we have the image URL as well If you remember in the previous video, you know why we need that And then we create a new skin button using this this information using this data So this is skin button will use the data that we just gathered and we are going to connect its Preset signal to this skin button pressed. This is actually important. So let's see how this works We request we make an HP request to this URL to retrieve the scene from the looklocker server and then we use for the response mainly I delete a skin file that is on the player's machine to prevent Weird corruption on the file So I remove it completely and I recreate this file using the data that we just gathered as a response from this request here and then I set the current skin to know to prevent any weird interaction and then I said I'll load this scene from the the file that we just created using the the file that we retrieved from this HP request here and Load it as a packet scene resource to this skins single term and then we meet this skin selected signal So this is how this whole inventory works And if we give another another asset to our player So let's give it to let's actually see this in real time play. We just entered Play this skins loaded. So we just have this skin Let's give this area sent to this player asset granted. Let's go back and update this And there we have it so I can select this Load it and I have So this is it for this video. I really hope you enjoyed in the next one in the next video We are going to see how we can automate the process of actually giving players assets So for instance, we can create an event in the game. Let's say for instance when players reach 1000 points they are granted a special skin so that they can use and celebrate this achievement and We are going to see how we can do that using triggers. So I really hope you enjoyed Thank you so much for watching keep developing and to the next one