Hello, I recently attempted to randomize the players appearance, however it only seems to work if I you the PlayerAdded command. I want to randomize every character's appearance within a table using a function.
In order to make randomization simple I ran multiple tests to see what the population of roblox is, I got values between 16, and 145599999. anything below 16 can give errors because they no longer exist.
So basically this:
game.Players.PlayerAdded:connect(function(Player)
Player.CharacterAppearance = "http://www.roblox.com/Asset/CharacterFetch.ashx?userId="..math.random(16, 145599999)
end)
the above works fine, but for some reason when I try to incorporate it in a function like this:
function randomizecharacter()
for _, player in pairs(game.Players:GetPlayers()) do
delay(1, function(player)
player.CharacterAppearance = "http://www.roblox.com/Asset/CharacterFetch.ashx?userId="..math.random(16, 145599999)
end)
end
end
It doesn't work at all or give errors.
So how can I randomize players based on a user id value between 16, and 145599999 using a call able function and not only from when the player is added.
Thanks in advance if anyone actually answers this.

1 comment
Forgive me for not clearifying, but I do infact know how to call a function... I posted this question here because the function did not work, not because I didn't know how to call it or forgot. What you see above is simply the functions I'd like to call but for somereason they don't work. Sorry for the clearity.