How do I get the player to get a new loadout after every death?

I’m looking to create a new simple game, a baseplate with a simple design, but the players have different load outs of weapons each time they die. How can I create a script where each time the player dies, a new load out is given to them?

You can try to pick a random item from each table that hold items in them. For example, PrimaryTable, SecondaryTable, AttachmentOneTable and so on. You can grab these items from their assigned folders that you could set with the tables. Hope this helped you, but you could try and explain it somehow a bit better if it didn’t.

2 Likes

Thanks, I understand it now. Kinda like how the game arsenal’s random loadout works is what I’m trying to get to. Thank you!

local primary = {gun1, gun2, gun3}
local secondary = {sword1, sword2, sword3}
local consumable = {hp1, hp2, hp3}

local primRand = primary[math.random(1, #primary)]
local primRand.Parent = player.Backpack

This obviously won’t work as it is but it’s the logic you should be aiming to achieve.

1 Like