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

How to change the player's model with code? [SOLVED]

Asked by 6 years ago
Edited 6 years ago

So I'm trying to make a game where the players load in, there is a short period of time that passes, and then the game chooses one player at random and makes them the "monster". Please keep in mind that I'm a noob. Well, I have the model for the monster and know the code for everything else, but I don't know how to change the player's model to the monster model. I've searched online for a few days but I couldn't find a way to do it while the game is running. Any help? Please let me know if you don't understand the question and I can try to explain further.

Edit: I was able to figure it out by experimenting with some variations of the code suggested in the comments. Here is my code:

local monster = game.ReplicatedStorage.Monster

game.Players.CharacterAutoLoads = false

game.Players.PlayerAdded:Connect(function(player)
    print("Found Character")
    local monsterCharacter = monster:Clone()
    monsterCharacter.Parent = workspace
    monsterCharacter:MoveTo(Vector3.new(0,50,0))
    player.Character = monsterCharacter
end)

Now all I have to do is add animations to the character. Thanks to everybody that helped!

0
Look into "loadCharacterAppearance" and "ClearCharacterAppearance".  Note that ClearCharacterAppearance doesnt remove tshirts, head meshes or faces.   ABK2017 406 — 6y
0
Ok I will look into those and report back here. BaconMan1455 4 — 6y
0
All I can get it to do is remove the player's clothes but the model still stays the same. BaconMan1455 4 — 6y
0
@BaconMan1455 Try deleting the player normal meshes and adding your owns... (add yours before deleting) Leamir 3138 — 6y
View all comments (2 more)
0
player.Character = monsterCharacter hellmatic 1523 — 6y
0
I updated the question by adding my code. BaconMan1455 4 — 6y

Answer this question