I’m trying to make a chest that when you hold F it plays an Animation for 3 seconds and then It opens the chest, and gives you random loot.
Could anyone help me?
I’m trying to make a chest that when you hold F it plays an Animation for 3 seconds and then It opens the chest, and gives you random loot.
Could anyone help me?
You could add a ProximityPrompt object to your chest. Set the duration you need to hold down the key for to 3 seconds. Then, when the prompt is activated, you play the animation on the player who activated the prompt for the three seconds that they are using the prompt to open the chest. Next, animate the chest opening up. You would then select random loot and give it to the player however you choose to do so.
Thank you so much, it worked, but I have a question would I have to put more tools in to change the rarity of a gun. For example, Say I put in 20 Ak47s tools to make the gun more common?
You could do that or use math.random to select a random item from a list. Each would be assigned a range of numbers and select that item if the random number generated is between it’s range. There are other ways you could do this as well, I recommend you look into them.
I would recommend using a weight system to pull items by using dedicated values.
An example can be found here: How would I make something appear more depending on the rarity?