-
What do you want to achieve? I’m working on what is essentially a crafting system. A modulescript contains the materials required to upgrade a given weapon, from levels 1-10.
-
What is the issue? When printed, my table is returning levels 1-10, but instead of showing as strings listing the material’s name, they all show up as “false.”
-
What solutions have you tried so far? I looked at other posts on the DevForum but none seemed to have this exact issue.
This is the code I have in the ModuleScript, which is in ReplicatedStorage:
local module = {}
local KeybladeMaterials = {
--Example--
-- [1] = {Soothing Stone = 2, Sinister Stone = 1, Orichalcum = 1} --
[1] = {"Lucid Shard" == 1},
[2] = {"Lucid Shard" == 2},
[3] = {"Hungry Shard" == 2},
[4] = {"Lucid Shard"==3,"Hungry Shard"==2,},
[5] = {"Blazing Shard"==3},
[6] = {"Lucid Shard"==3,"Hungry Shard"==3,"Blazing Shard"==3},
[7] = {"Lucid Stone"==1},
[8] = {"Lucid Stone"==3},
[9] = {"Blazing Stone"==1},
[10] = {"Mythril Shard"==1},
}
module.ReturnedInformation = function(plr, keybladeLevel)
print('Returned information for: ' .. script.Name)
print(plr)
print(keybladeLevel)
print(KeybladeMaterials) --All values return as [1]=false
return KeybladeMaterials[keybladeLevel]
end
return module
And this is the code I have on the client, which is caling require() on it.
local KeybladeInfo = require(ReplicatedStorage.Modules.KeybladeInfo)
local CurrentMaterials = KeybladeInfo.ReturnedInformation(Player, 2) --The "2" is a stand-in for the weapon's level.
print(CurrentMaterials)--This returns as [1] = false
Any help would be appreciated!