How would I go about cleaning this up? Mainly the commented section:
local function gamepassHandler(player)
local gp = Instance.new("Folder", player)
gp.Name = "Gamepasses"
local cm = Instance.new("BoolValue", gp)
cm.Name = "CashMulti"
local st = Instance.new("NumberValue", gp)
st.Name = "Storage"
--[[
local tf = Instance.new("BoolValue", st)
tf.Name = "25Storage"
local ffty = Instance.new("BoolValue", st)
ffty.Name = "50Storage"
local svf = Instance.new("BoolValue", st)
svf.Name = "75Storage"
local db = Instance.new("BoolValue", st)
db.Name = "100Storage"
--]]
local user = player.UserId
local gamepassIDS = game:GetService("ReplicatedStorage"):WaitForChild("GamepassID")
local gamepasses = {
['25S'] = gamepassIDS:WaitForChild("25Storage").Value,
['50S'] = gamepassIDS:WaitForChild("50Storage").Value,
['75S'] = gamepassIDS:WaitForChild("75Storage").Value,
['100S'] = gamepassIDS:WaitForChild("2xStorage").Value,
['2xCash'] = gamepassIDS:WaitForChild("2xCash").Value
}
for name, id in pairs(gamepasses) do
local hasPass
local success, message = pcall(function()
hasPass = MarketplaceService:UserOwnsGamePassAsync(user, id)
end)
if hasPass then
print("Has Gamepass: "..id)
if name == '25S' then
tf.Value = true
elseif name == '50S' then
ffty.Value = true
elseif name == '75S' then
svf.Value = true
elseif name == '100S' then
db.Value = true
elseif name == "2xCash" then
cm.Value = true
end
end
end
end