so i have skills
Skills ={
["SkillPoint"] = 0;
SkillCash =
{
SkillPoints = 1,
Prereqs = {},
Unlocked = false,
},
SkillCash2 =
{
SkillPoints = 3,
Prereqs = { "SkillCash" },
Unlocked = false,
},
}
i need help with Prereqs, i tried do code by myself but i cant understand this part
i have function prereqsMeet that tried to check does prereqs upgraded
So it should do like that, trying to upgrade SkillCash2, prereqs = SkillCash, SkillCash["Unlocked" = true]
But idk how to do that
function prereqsMeet(player, Skill)
local prereqs = Skill["Prereqs"]
print(prereqs)
for _, name in prereqs do
if not table.find(Skill, Skill["Unlocked" == true]) then
print("False")
return false
end
end
print("True")
return true
end
there is my try, when there is no prereqs its working, but if it have 1 or more table.find(Skill, Skill["Unlocked" == true]) always be nil
(sorry for much text)
