[HELP] I new to using tables. How do I have it so if playermodel = any value in table?

Like I said in the title.

If I have a table like this.
Playermodels ={

So how would I have it so like
if ply:GetModel = Playermodels{}?

  • you’re not calling GetModel
  • you’re using the assignment operator rather than the equality operator
  • you’re using the wrong braces
  • random question mark
  • you need to loop through the table

I’m not saying thats what I’m doing I’m asking how would I do it ^ that was just a random thing I put in case some people don’t understand what I’m talking about and I’m pretty sure those are the right braces

[editline]25th November 2016[/editline]

oh I know what you mean with braces I think are you talking about these?

Why would he need to loop through the table?

ply:SetModel( table.Random( Playermodels ) );

I’m not trying to set model to a random model in that table

I’m trying to recieve if the players playermodel is one of the models inside of the table.

Ah yeah sorry, thought you wanted the playermodel to be one of those.

table.HasValue( Playermodels, ply:GetModel() );

Didn’t know about this function, thanks.

thx alot I saw table.HasValue but didn’t know it could be used this way I’ll try it out