I’m extremely tired at the moment of writing this and i cannot think of a way to make the loot pool randomized every time you open a stash.
The script is messy but i will clean it up soon.
local cl = game.ReplicatedStorage.INVENremotes.Close
Debris = game:GetService("Debris")
local Global = require( game:GetService("ReplicatedStorage").kInteracts_ReplicatedStorage.Global )
local Attachment = script.Parent.Example
local InteractionPoint = Global:InitializeInteractObject(Attachment)
InteractionPoint.Interacted:Connect(function(plr)
local g = plr.PlayerGui.LootInventory
local l = g.MainLoot.LootLayout
local c = script.Parent.LootSettings.Contents
local ls = script.Parent.LootSettings
cl:FireClient(plr)
print("Universal", ls.LootType.Universal.Value)
print("Stash",ls.LootType.Stash.Value)
print("Millitary",ls.LootType.Millitary.Value)
print("Scrap",ls.LootType.Scrap.Value)
if ls.LootType.Universal.Value == true then --UNIVERSAL
for _, Child in pairs(script.Parent.LootSettings.Contents:GetChildren()) do
if Child:IsA("BoolValue")then
if Child.Name == "Watch" then
l.Watch.Visible = true
elseif Child.Name == "Flash" then
l.Flash.Visible = true
elseif Child.Name == "Screwdriver" then
l.Screwdriver.Visible = true
elseif Child.Name == "Grenade" then
l.Grenade.Visible = true
elseif ls.LootType.Stash.Value == true then --STASH
if Child.Name == "Watch" and Child.Value == true then
l.Watch.Visible = true
elseif Child.Name == "Flash" and Child.Value == true then
l.Flash.Visible = true
elseif ls.LootType.Scrap.Value == true then --Scrap
if Child.Name == "Watch" and Child.Value == true then
l.Watch.Visible = true
elseif Child.Name == "Screwdriver" and Child.Value == true then
l.Screwdriver.Visible = true
end
end
end
end
end
end
end)