Help Needed! [FAST ITS A SUPRISE FOR MY FRIEND]

I want to find if the userid is in the table below or not when the user is joining the game…

image

I need this for my nametag script…

TRIED so far:

image

Varables:

1 Like
if Boosters[P.Name] == P.UserId then

end

if you wanted to use table.find(), then you should just store the UserId, you don’t need to make the Name equal the UserId

then you could do

if table.find(Boosters,P.UserId) then

end
2 Likes

loop through the table.

game.Players.PlayerAdded:Connect(function(plr)
   for i = 1, #table do --table being your dictionary
      if table[i][UserId] == plr.UserId then -- You'll have to reconstruct this phrase to reference the key in the dictionary
         --More code here
      end
   end
end)
2 Likes

Thanks very much for the help you are a star!

This was for popsiz

2 Likes

You hevally over complicated something so simple.

1 Like

There are multiple ways to go about any one task.

Neither are wrong, just different. Mine checks when a player joins, looping through a table, which stores a reference so you can easily check other members of the specific key. The other answer is great for checking a single piece of data, but fails to reference the key.

Both answers work, they are just used in different scenarios.

2 Likes