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

how to check a table's contents one by one?

So, I have a table called "competitors" with a list of player's Name. What I want to know is, how would you check the table's contents one by one because I want to find the players who are in the table in Workspace by doing

game.Workspace:FindFirstChild("competitors")

or something

2 comments

0

Are the values in the table PlayerObjects or strings? https://scriptinghelpers.org/blog/it-works-in-studio-but-not-online

0

strings

1 answer

try something like this its a string to table and table to string converter kinda system

players=""
for i,v in pairs(game.Players:GetPlayers()) do
	players=players.."{"..v.Name.."}"
end
function parse(str,pre,suf)
	local strings={}	
for i in string.gmatch(str,pre..".-"..suf) do 
  local i2=0
	i2=i2+1
	table.insert(strings,string.sub(i,2,string.len(i)-1))
	
	end
return strings
end
for i,v in pairs(parse(players,"{","}")) do
	print(v)
end

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