Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function RSGMod()
- local rsg = {}
- local index = 1
- --Determine weapon
- local wepIndex = RSWeaponPacks[math.random(#RSWeaponPacks)]
- rsg[index] = RSWeaponPacks[wepIndex].weapon[1]
- index = index + 1
- --Add ammo
- if RSWeaponPacks[wepIndex].ammo ~= {} then
- for i=1, math.random(RSWeaponPacks[wepIndex].ammo[2]) do
- rsg[index] = RSWeaponPacks[wepIndex].ammo[1]
- index = index + 1
- end
- end
- --Add Bomb items
- local expIndex = RSExplosivePacks[math.random(#RSExplosivePacks)]
- local expNum = math.random(RSExplosivePacks[expIndex].number)
- for i=1, expNum do
- rsg[index] = RSExplosivePacks[expIndex].item[1]
- index = index + 1
- end
- --Determine Rare items
- local luckRoll = math.random()
- if luckRoll < 0.25 then --25% chance for extra item
- if luckRoll < 0.05 then --5% chance for rarer item
- local URIndex = math.random(#RSUltraRare)
- for i=1, #RSUltraRare[URIndex]
- rsg[index] = RSUltraRare[URIndex][i]
- index = index + 1
- end
- else
- local RIndex = math.random(#RSBonusPacks)
- for i=1, #RSBonusPacks[RIndex] do
- rsg[index] = RSBonusPacks[RIndex][i]
- index = index + 1
- end
- end
- end
- return rsg
- end
Advertisement
Add Comment
Please, Sign In to add comment