Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with character appearance?

Asked by 8 years ago

the script doesnt work in studio, but in servers it automatically crashes the game.

game.Players.PlayerAdded:connect(function(Player)
Player.CharacterAppearance = "http://www.roblox.com/Asset/CharacterFetch.ashx?userId=70701268" 
Player.Character:BreakJoints()
end)

1 answer

Log in to vote
1
Answered by 8 years ago

The Issue is that the script is running before the players character is loaded

function onPlayerEntered(player)
    wait(0.25)
    player.CharacterAppearance = "http://www.roblox.com/Asset/CharacterFetch.ashx?userId=261" --Shedletsky
    player:LoadCharacter(true)
    repeat wait () until player.Character ~= nil
end
game.Players.PlayerAdded:connect(onPlayerEntered)

Hope this helps

Ad

Answer this question