Okay, so I have an idea... In my game when I player kills another player I want the killer's appearance to switch to the person they killed. How would I do since, this function seems to be only abled to be called when the player joins?
local appearance = math.random(16, 145599999)
game.Players.PlayerAdded:connect(function(Player)
Player.CharacterAppearance = "http://assetgame.roblox.com/Asset/CharacterFetch.ashx?userId="..appearance.."&placeId=YOURPLACEID"
end)
and yes, I know the function will be called when the player joins or respawns, but that's just it, the function will not work in say this form...
function thiswontwork ()
local appearance = math.random(16, 145599999)
for _, player in pairs(players) do
player.CharacterAppearance = "http://assetgame.roblox.com/Asset/CharacterFetch.ashx?userId="..appearance.."&placeId=453266817"
end
end
The above will not work, even this wont work:
game.Players.PlayerAdded:connect(function(Player)
local appearance = math.random(16, 145599999)
wait(0.1)
Player.CharacterAppearance = "http://assetgame.roblox.com/Asset/CharacterFetch.ashx?userId="..appearance.."&placeId=YOURPLACEID"
end)
It seems to me that once the appearance id is set, you can't change it. So how can I change it even when it is set?
The admin houses allow for this, where you can use an admin type command to change to the player appearance id of your choice.
Thanks in advance

2 comments
mmmm, well you see here, I did define players, just not here lol the function didnt seem to work for me, is it local or global, what script type does it belong? Either way it doesn't work, but gives no errrors
Give me your entire script, then I may be able to make it work for you, otherwise everything I told you does work, its just the way you use it, makes it break. (I did a full test on both as I did mention)