Avatar change on join

Hey! I’m wondering if it’s possible for one player (on join) to have their avatar changed (add hats and change faces). I would only like this to happen to selected players. Does anyone know how to accomplish this?

thanks in advance

Basically just make a table of all the players you want this to happen for then, make a player added event and loop through the table and check if the players in that table are in the game and if they are then a character added event then do whatever you want and add accessories and such

Example

(Server Script)

local SelectedPlayersIDs = {

123431243,
123432342,
345423522,


}

function Added(plr)
   plr.CharacterAdded:Connect(function(char)
   for i,v in pairs(SelectedPlayers) do
      if plr.UserId == v then
      print("This player is in the table!")
      --- Do stuff!
end

game.Players.PlayerAdded:Connect(Added)
2 Likes

Thanks, I’ll give it a go. 30chars

1 Like

Thanks, no problem make sure to mark my post as a solution if it worked for you so other people with the same problem can solve theirs’ faster!

1 Like

Will do after I make sure it works :slight_smile:

1 Like

Alright, nice!
[30 Characters]

Its UserId, not PlayerId.

1 Like

Sorry, my fault she’ll probably notice that

1 Like