I am attempting to make code that will change your avatar to a random premade avatar when you join, or if your user id matches will give you a specific avatar, without using StarterCharecter. Ive been going around trying to get help for a while but nothing is helping. This code isn't finished as I've been super stumped (I'm a amateur ). All responses are appreciated.
local allStarterCharacter = {workspace.StarterCharacter1,workspace.StarterCharacter2,workspace.StarterCharacter3.StarterCharacterSP} -- You put all your playermodels in a table using {}
local pick = math.random(1,#allStarterCharacter ) -- By adding # behind a table, it gives you the amount of values it has (3 in this case)
local clone = allStarterCharacter[pick]:Clone()
local Players = game:GetService("Players")
Players.PlayerAdded:Wait()
for i, v in pairs(Players:GetPlayers()) do
if v.UserId == 847431372 then
pick then clone
else
end
end
