local module = {
Task1 = {title = "Go to shop",progress = 1},
Task2 = {title = "Sell your gems",progress = 1},
Task3 = {title = "Kill a player in PVP zone",progress = 1},
Task4 = {title = "Reach level 5",progress = 5},
Task5 = {title = "Go to Moon",progress = 1},
Task6 = {title = "Increase your walkspeed",progress = 1}
}
I want to get the total number of the Tasks, so I tried this
local ServerStorage = game:GetService("ServerStorage")
local Module = require(ServerStorage:WaitForChild("ModuleScript"))
local TotalQuest = #Module:GetChildren()
print(TotalQuest)
local function GetTotalQuests()
local TotalQuests = 0
for _,Quest in pairs(Module) do
TotalQuests = TotalQuests + 1
end
return TotalQuests
end
print(GetTotalQuests)