So, for some reason i can’t find stuff in my module script with these thing []
This script gives the error: attempt to index nil with ‘level’
print(questModule.Bob.level) -- prints 1
for i,questCharacter in pairs(questCharactersFolder:GetChildren()) do
print(questCharacter) -- prints Bob
if player.leaderstats.Level.Value >= questModule[questCharacter].level then
local quests = {
Bob = {
name = "Neighbourhood Watch",
text = "This was a beautiful neighborhood until all these bandits came, could you get rid of them for me?",
enemy = {["Enemy"] = 5},
level = 1,
reward = {["Xp"] = 25}
}
}
return quests