Hello, I am having trouble with module script.
my issue is that I have a table that I need to access from the server script. the table is okay when I print it from the module script, but when I print it on the server script it is nil for some reason
This is module script
local Rocks = {
["FirstRocks"] = {
["Damaged"] = {5},
["Broke"] = {},
["Ores"] = {
[1] = {3,"Silver",3,5}, -- Chance,What,Weight (min-max)
[2] = {97,"Bronze",1,3}
}
},
["FirstRocks2"] = {
["Damaged"] = {10},
["Broke"] = {},
["Ores"] = {
[1] = {3,"Silver",3,5}, -- Chance,What,Weight (min-max)
[2] = {97,"Bronze",1,3}
}
},
["FirstRocks3"] = {
["Damaged"] = {15},
["Broke"] = {},
["Ores"] = {
[1] = {5,"Silver",3,5}, -- Chance,What,Weight (min-max)
[2] = {95,"Bronze",1,3}
}
}
}
function Rocks.Damaged(Damage,WhichRock,Broken,GamePass,Rebirths)
task.spawn(function()
print(Damage,WhichRock,Broken,GamePass,Rebirths)
local random = Random.new():NextNumber(0, 100)
local counter = 0
local Ore = ""
for i,v in pairs(Rocks[WhichRock.Name]["Ores"]) do
counter += v[1]
if random <= counter then
Ore = v[2]
end
end
local rocks = (Rocks[WhichRock.Name]["Damaged"][1] + Damage) * Rebirths
local STATS = {
rocks,
Ore
}
print(STATS)
return STATS
end)
end
return Rocks
this is server script:
and this is the output