Unfortunately still same error.
May I see your code? I don’t think its anything wrong with what I sent you. At least the line where the error is happening.
Yes this is the part of the code
function CodesFunction.OnServerInvoke(Player, Code)
local CodesFolder = Player:WaitForChild("CodesFolder")
for Key, Value in pairs (Codes) do
if string.lower(Value) == string.lower(Code) and not CodesFolder:FindFirstChild(Code) then
note: I am planning to do the same thing with this
CodesFolder:FindFirstChild(Code)
Codes - is the table
Hmm can you send that entire function please.
function CodesFunction.OnServerInvoke(Player, Code)
local CodesFolder = Player:WaitForChild("CodesFolder")
for Key, Value in pairs (Codes) do
if string.lower(Value) == string.lower(Code) and not CodesFolder:FindFirstChild(Code) then
print("find")
local CodeTable = Codes[Code]
local CodeActive = CodeTable[1]
if CodeActive then
local BoolValue = Instance.new("BoolValue")
BoolValue.Name = Code
BoolValue.Parent = CodesFolder
print("done")
return 3
else
return 2
end
else
return 1
end
end
end
And can you tell me the exact line of error also?
if string.lower(Value) == string.lower(Code) and not CodesFolder:FindFirstChild(Code) then
Ok so is there a stringvalue in the CodesFolder or something?
edit:
nvm
Ok, Instead can you send the entire script? I would also make sure there is nothing else named Value, Code, Key, Codes, or CodesFolder.
edit:
The error does seem to be something to do with a reference error/wrong reference. So double check the names of your values.
Oh I forgot to state that its Module Script Table
local Codes = require(script.Codes)
Why? Just have the table in our script. Also if you dont want to change it just show me whats in the module.
local Codes = {
["testingcode"] = {true},
}
return Codes
local Codes = {
testingcode = true,
}
return Codes
It detects as first return.
So “invalid”
What detects as a first return?
if string.lower(Value) == string.lower(Code) and not CodesFolder:FindFirstChild(Code) then
and if this is not passed it returns 1 - Invalid
Ah I see change the string.lower(Value) to string.lower(Key). I would also just recommend having the table in the script.
Still and I will probably need to do it.
Well I dont know how I did not think of this before but are you ever calling for the table/is your module returning it to the script (ik it has return but try putting it in a function like below)? As your just requiring the module.
Script (Codes var):
local Codes = require(script.Codes):Get()
Module:
local module = {}
function module:Get()
local Codes = {
testingcode = true,
}
return Codes
end
return module
No it still returns as invalid.