I think this may be a roblox bug, but i dont really know if it is or not. I have a datastore system that works fine, it saves, and etc. And then i have a Module script system which also works, But this is where my problem is..
LOCAL SCRIPT IN A GUI:
local info = statsProvider.getKeyInfo("KEY_"..keyValue.Value) if info == nil then return end keyIcon.Image = info[2] equipToolFrame.Info1.TextL.Text = ("Key: ".. info[1])
STATS PROVIDER:
keyInfo = { --[[ Magical - Common Legend - Uncommon Mystical - Rare Myth - Legendary --]] KEY_Venom = { "Venom", --NAME "rbxassetid://3447071395", --ICON "Magical", --Rarity "4", --STRENGTH }, KEY_Circlet = { "Circlet", --NAME "rbxassetid://3453811947", --ICON "Magical", --Rarity "3", --STRENGTH }, } local module = {} module.getKeyInfo = function(item) return keyInfo[item] end return module
statsProvider = the module script, (called it correctly, using require.) i tried removing the line,
if info == nil then return end
and it still didnt work. My problem is, is that the script isn't getting "info" and no error is printed in the output.. how do i know its not getting the "info"?
keyIcon.Image = info[2] equipToolFrame.Info1.TextL.Text = ("Key: ".. info[1])
those lines don't work... The image is not appearing, and it should, i to see if the keyIcon is visible and it is.. The strange part happens when, it does retrieve the data, and the lines;
keyIcon.Image = info[2] equipToolFrame.Info1.TextL.Text = ("Key: ".. info[1])
Do work, but only if the datastore key is: "Testing8.4", any other key DOESNT work..? Wtheck is up with this? * one reason why I think it may be a roblox bug is because this wasn’t a problem before I updated studio recently
The line "if info == nil then return end" messed it up somehow. I removed it and added a value in the table "KEY_None" which solved it.. I don't even know how or why but, thanks for the help everyone!