repeat task.wait() until game.Players.LocalPlayer:FindFirstChild("_loadeddata")
local Player = game.Players.LocalPlayer
local f = script.Parent.Frame
local bm = f.BoosterMain
local plrBoosters = Player:WaitForChild("Boosters")
for i, v in pairs(game.Lighting.Boosters:GetChildren()) do
local module
if v:IsA("ModuleScript") then
module = require(v)
end
local imgButton = script.b:Clone()
imgButton.Parent = bm
imgButton.Name = v.Name
local booster = plrBoosters:FindFirstChild(v.Name)
if booster and booster.Value == true then
imgButton.Image = module.Icon
elseif booster and booster.Value == false then
imgButton.Image = module.LockIcon
end
imgButton.MouseButton1Click:Connect(function()
local booster = plrBoosters:FindFirstChild(v.Name)
if booster and booster.Value == false then
f.Info.Visible = true
f.Info.BoosterIcon.Image = module.LockIcon
f.Info.BoosterName.Text = "???"
f.Info.BoosterDesc.Text = "You haven't unlocked this booster yet."
elseif booster and booster.Value == true then
local status = game.Lighting.EquipBooster:InvokeServer(v.Name)
print(status)
f.Info.Visible = true
f.Info.BoosterIcon.Image = module.Icon
f.Info.BoosterName.Text = v.Name
f.Info.BoosterDesc.Text = module.Desc
end
end)
end
the module is a script and the code of it is
return {
Desc = "Double your jumps with this Booster!",
Action = "Double Jump",
Reward = "Double Jump",
Goal = game.Lighting.Bosses.UndertaleAU.Flowey,
GoalDef = "onBeaten",
LockIcon = "rbxassetid://xxx",
Icon = "rbxassetid://xxx",
}
image 1 shows that no image is being showen
image 2 shows that the image loads fine on the lower part if you click on the unknown image