"X is not a valid member of" when it is a direct child

For some reason my script is erroring as "BindKb is not a valid member of (address).K1, when it is in fact, a valid member of K1.

Pictures of the explorer hierarchy
image

Here’s the script, even though i don’t think it’d help a whole bunch

local function updKeybind(key)
	local kUI = ui.MainUI.P3.Keys
	local curK = kUI:FindFirstChild("K"..set.Value)
	
	if canDPad == true then
		if key.KeyCode == upKb or key.KeyCode == upCt then
			curK.BindKb = upKb
			curK.BindCtrl = upCt
		elseif key.KeyCode == dnKb or key.KeyCode == dnCt then
			curK.BindKb = dnKb
			curK.BindCtrl = dnCt
		elseif key.KeyCode == leKb or key.KeyCode == leCt then
			curK.BindKb = leKb
			curK.BindCtrl = leCt
		elseif key.KeyCode == riKb or key.KeyCode == riCt then
			curK.BindKb = riKb
			curK.BindCtrl = riCt
		end
	end
	
	if key.KeyCode == crKb or key.KeyCode == crCt then
		curK.BindKb = crKb
		curK.BindCtrl = crCt
	elseif key.KeyCode == ciKb or key.KeyCode == ciCt then
		curK.BindKb = ciKb
		curK.BindCtrl = ciCt
	elseif key.KeyCode == sqKb or key.KeyCode == sqCt then
		curK.BindKb = sqKb
		curK.BindCtrl = sqCt
	elseif key.KeyCode == trKb or key.KeyCode == trCt then
		curK.BindKb = trKb
		curK.BindCtrl = trCt
	elseif key.KeyCode == l1Kb or key.KeyCode == l1Ct then
		curK.BindKb = l1Kb
		curK.BindCtrl = l1Ct
	elseif key.KeyCode == r1Kb or key.KeyCode == r1Ct then
		curK.BindKb = r1Kb
		curK.BindCtrl = r1Ct
	elseif key.KeyCode == l2Kb or key.KeyCode == l2Ct then
		curK.BindKb = l2Kb
		curK.BindCtrl = l2Ct
	elseif key.KeyCode == r2Kb or key.KeyCode == r2Ct then
		curK.BindKb = r2Kb
		curK.BindCtrl = r2Ct
	end
	print("KEY "..curK.BindKb.Value)
	print("CTRL "..curK.BindKb.Value)
end

aaand here’s a picture of the error itself…
image

i’m genuinely at a loss with this, and i have absolutely no idea how i could manage to fix this while keeping the same organization (because it’s the best i can do for convenience)

any help is appreciated

BY THE WAY: THIS WAS ME BEING STUPID, PLEASE DON’T COMMENT ON THE LACK OF A “.Value” BECAUSE IT WAS A “LAZY WILL DO LATER” THING … I AM SORRY DEVFORUM I FAILED YOU

1 Like

In the code you provided, at the bottom you put curK.BindKb, when it is actually supposed to be BindKB.

Hope this helps. :slight_smile:

1 Like

OH MY GOD I AM MY OWN WORST NIGHTMARE

i am so sorry i am incredibly sleep deprived :sob::sob::sob::sob::sob: i cant keep going on like this

It’s ok. Little misspellings like that can cause some problems, make sure to look over it sometimes.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.