Why is this check script not inserting into the table?

Achieve

I’m trying to achieve a check system for a certain folder and if I do find that folder… it puts that value or string into the table for me to access and use for this said idea.

Issue

image

Solutions

I’ve tried using a table, string and so on and nothing seems to work.

local ID = {Screens = "",Properties = ""}
local function ScreenChecker(ScreenName)
	if game.Workspace:FindFirstChild("Equipment") then 
		ID[1] = game.Workspace.Equipment.Screens --Screens
		ID[2] = ".Image" -- Property
	else
		ID[1] = game.Workspace --Screens
		ID[2] = ".Decal.Texture" --Property
	end
end
ScreenChecker()
	local ScreenName = "TVTop"
	local AssetLink = "http://www.roblox.com/asset/?id="
	if SettingsToggle then
		repeat
			ID["Screens"].ScreenName.ID["Properties"] = AssetLink.."4824725178" 
			wait(0.5)
			ID["Screens"].ScreenName.ID["Properties"] = AssetLink.."4824724623" 
			wait(0.5)
			ID["Screens"].ScreenName.ID["Properties"] = AssetLink.."4824725178" 
			wait(0.5)
			ID["Screens"].ScreenName.ID["Properties"] = AssetLink.."4824724623" 
			wait(0.5)
			ID["Screens"].ScreenName.ID["Properties"] = AssetLink.."4824725178" 
			wait(0.5)
			ID["Screens"].ScreenName.ID["Properties"] = AssetLink.."4824724623" 
			wait(0.5)
			ID["Screens"].ScreenName.ID["Properties"] = AssetLink.."4824725178" 
			wait(0.5)
			ID["Screens"].ScreenName.ID["Properties"] = AssetLink.."4824724623" 
			wait(0.5)
		until not SettingsToggle
	end

Thank you for any help you can give me.

Your table is an object not an array, It’d be something like this

local ID = {Screens = "",Properties = ""}
local function ScreenChecker(ScreenName)
	if game.Workspace:FindFirstChild("Equipment") then 
		ID.Screens= game.Workspace.Equipment.Screens --Screens
		ID.Properties= ".Image" -- Property
	else
		ID.Screens = game.Workspace --Screens
		ID.Properties = ".Decal.Texture" --Property
	end
end

and a recommendation fr your changing effect.

		repeat
			for i = 1, 8, 1 do
				if not SettingsToggle then
					break
				end

				ID["Screens"].ScreenName.ID["Properties"] = AssetLink.."4824725178";
				wait(.5);
				ID["Screens"].ScreenName.ID["Properties"] = AssetLink.."4824724623";
			end
		until not SettingsToggle
1 Like

Okay, thank you for this answer!
Do you think you could help me with one more issue?

Error

image

Script

local ScreenName = "TVTop"
	local AssetLink = "http://www.roblox.com/asset/?id="
	if SettingsToggle then
		repeat
			ID["Screens"].ScreenName.ID["Properties"] = AssetLink.."4824725178" 

̶I̶t̶ ̶l̶o̶o̶k̶s̶ ̶l̶i̶k̶e̶ ̶y̶o̶u̶’̶r̶e̶ ̶t̶r̶y̶i̶n̶g̶ ̶t̶o̶ ̶a̶c̶c̶e̶s̶s̶ ̶s̶o̶m̶e̶t̶h̶i̶n̶g̶ ̶c̶a̶l̶l̶e̶d̶ ̶"̶S̶c̶r̶e̶e̶n̶N̶a̶m̶e̶"̶ ̶i̶n̶s̶i̶d̶e̶ ̶o̶f̶ ̶"̶s̶c̶r̶e̶e̶n̶s̶"̶,̶ ̶M̶a̶k̶e̶ ̶s̶u̶r̶e̶ ̶t̶h̶i̶s̶ ̶e̶x̶i̶s̶t̶s̶.̶ ̶I̶f̶ ̶i̶t̶ ̶d̶o̶e̶s̶ ̶e̶x̶i̶s̶t̶ ̶t̶h̶e̶n̶ ̶ ̶p̶r̶o̶b̶a̶b̶l̶y̶ ̶a̶p̶p̶l̶y̶ ̶a̶ ̶w̶a̶i̶t̶ ̶b̶e̶f̶o̶r̶e̶ ̶i̶t̶ ̶e̶x̶i̶s̶t̶s̶.̶

Ah oh I see a “local ScreenName = "TVTop"” in your script, This probably means “TVTop” dosn’t exist or it’s looking for something called “id”

here try this

				ID["Screens"][ScreenName][ID["Properties"]] = AssetLink.."4824725178";
				wait(.5);
				ID["Screens"][ScreenName][ID["Properties"]] = AssetLink.."4824724623";

You might need to change the “.image” thing for properties to be something as simple as “image”,
and for the “.decal.texture” chance the screens to game.Workspace.Decal and properties to “Texture”.

I keep getting an error that states…
image

Code

ID["Screens"][ScreenName].ID["Properties"] = AssetLink.."4824725178" 
if game.Workspace:FindFirstChild("Equipment") then 
		ID.Screens = game.Workspace.Equipment.Screens
		ID.Properties = Image
	else
		ID.Screens = game.Workspace
		ID.Properties = Texture
	end

Note

The ScreenName is the screen its looking for so I can’t really put this in the script as you described.