Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I can't get the character's avatar appearance to change?

local sss = game:GetService("ServerStorage")

local customs = sss.customs

local tablechr = {}

for i, v in pairs(customs:GetChildren()) do
	table.insert(tablechr,1,v)
end

local chosenchr = tablechr[math.random(1, #tablechr)]


game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(chr)
		print(chr)		
		chr = chosenchr
	end)
end)

Above is basically just a script that gets the children (the character models) of a folder called customs. I then stored a randomised one out of those children in a variable. I then tried to set the character of the player joining equal to the new character (the variable chosenchr), but it doesn't work. Any help would be appreciated. (:

3 comments

0

Is the script a localscript? Anything in the Output?

0

it's just a normal server script that I put in the ServerScriptService

0

And no, nothing is displayed in the output.

1 answer

I don't want to misunderstand the default code of yours, so I carefully changed it a little bit.

--Set the player's default char to this
game.Players.PlayerAdded:Connect(function(plr)
	plr.Character = chosenchr
end)

If it is not the same idea as what you said, I will change it until you provide any further details.

2 comments

0

That doesn't work either sadly. Even then, I appreciate the help.

0

Ohh, maybe check other scripts. Because it works fine for me.

This discussion is preserved as it was. New answers, comments, and votes are closed.