So it returns what the text is, it even allows me to update the module script fine, yes settings is a module script.

Anyways it seems to error out on print(#("Possible"..v.Name)), as it returns the value 17, even when i set the print to print out the "i" value. How would i go about atleast fixing this;

for i = 1,#("Possible"..v.Name) do
---- Control Keys Check
PossibleSprint = {"SPRINT","E","Q","F"}
PossibleReload = {"Q","E","R","F"}
PossbileChat   = {"/","C","V","B"}

local Tick = false
for i,v in pairs(game.Players.LocalPlayer.PlayerGui.Hud.Settings.Controls.ControlKeys:GetChildren()) do
	v.InputEnded:connect(function() 
		if v.Text ~= tostring(Settings[v.Name]) and not Tick then
			Tick = true
			print(v.Text)
			for i = 1,#("Possible"..v.Name) do
				print(#("Possible"..v.Name))
				if v.Name == (("Possible"..v.Name)[i]) then
					Settings[v.Name] = v.Text
					print('updated to ' .. v.Text)
				end
			end
		Tick = false
		end
	end)
end

3 comments

0

Why are you putting a hashtag in front of strings? You can't do a for loop on strings, nor does a hashtag work on strings.

0

@shayner32 print(#'foo') will print 3. But you cannot access a string as an array.

0

So wheres the fix? Lol, its tieing my down and if there are alternate ways without using 50 if functions then ill do so.