Pretty simple but I just cannot tie my head around the current issue that the Dictionary is going through.
Here’s the script.
Dic = require(script.Dictonary)
local DictonaryHandler = {}
function DictonaryHandler.find(Player, Action)
return Dic[Player][Action]
end
function DictonaryHandler.add(Player, Action)
if not Dic[Player][Action] then
Dic[Player][Action] = true
end
end
function DictonaryHandler.remove(Player, Action)
if Dic[Player][Action] then
Dic[Player][Action] = nil
end
end
return DictonaryHandler
My best guess as to what is going on is maybe the script doesn’t know that Dic[Player] is a dictionary. I’ve had a similar issue before and configuring the table usually helps:
function DictonaryHandler.add(Player, Action)
if not Dic[Player] then
Dic[Player] = {}
elseif not Dic[Player][Action] then
Dic[Player][Action] = true
end
end