Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I check if a value is in a table?

For example:

local module = {}
Dev = "Dev"
Devid = {3889301,12891821029,18209309120293,0192093}
function module.Plan(argument)
	if argument == Dev then
		if game.CreatorId == -- one of the IDs in Devid
		warn("dev loaded")
		print(game.CreatorId)
		end
	end
end
return module

Please Help me awnser this :)

1 answer

✓ Accepted answer
local module = {}
local devtable = {3889301,12891821029,18209309120293,0192093}
function check(num)
for _,v in pairs(devtable) do
if v == num then
return true
end;end;end
function module.Plan(arg)
if arg == "Dev" and check(game.CreatorId) == true then
warn("dev loaded.")
warn(game.CreatorId)
end;end
return module

3 comments

0

Thanks

0

np

0

How would I also make it check if there is a diffrent Arg And If it is in a diffrent table?

This discussion is preserved as it was. New answers, comments, and votes are closed.