W003: (76,24) Global 'CreatedSlots' is only used in the enclosing function 'Main'; consider changing it to local
Code:
local FindOpenSlot = function(Tool)
for _,VSlot in pairs(CreatedSlots) do
if VSlot.Tool~=nil and VSlot.Tool == Tool then
return
end
end
for _,Slot in pairs(CreatedSlots) do
if Slot.Tool == nil then
return Slot
end
end
return CreateExtendedSlot()
end
I’m pretty confused, anyone know how to solve this?
local FindOpenSlot = function(Tool)
for _,VSlot in pairs(CreatedSlots) do
if VSlot.Tool~=nil and VSlot.Tool == Tool then
return
end
end
for _,Slot in pairs(CreatedSlots) do
if Slot.Tool == nil then
return Slot
end
end
return CreateExtendedSlot()
end
local FindSlotFromUI = function(Frame)
for _,Slot in pairs(CreatedSlots) do
if Slot.UI and Slot.UI == Frame then
return Slot
end
end
return nil
end
Output:
W003: (76,24) Global 'CreatedSlots' is only used in the enclosing function 'Main'; consider changing it to local
W003: (87,10) Global 'CreateExtendedSlot' is only used in the enclosing function 'Main'; consider changing it to local