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

How would I make a character spawn as a preset model?

If I had a model of a humanoid in server storage how would I make the character that spawns join looking like that model?

The Character is called Model. It's in ServerStorage The script is a local script in StarterGui

local modelMan = game.ServerStorage.Model
local player = game.Players.LocalPlayer
local character = player.Character
if not character or not character.Parent then
    character = player.CharacterAdded:wait()
end
modelMan.Parent = character.Torso -- Not sure how to weld

The problem I'm have with this is getting it onto the body. It's a fully functioning humanoid body but it just won't attach to the body and work with the ROBLOX animations. Is help possible? Thanks in advance.

1 answer

Setting the character is something very easy. You literally only need 1 line. If you wanna do stuff like copying the animations script into the new character then this will only take a few more lines.

-- Put this into workspace
NewCharacter = game.ServerStorage.Model:Clone() -- That's the new character
game.Players.PlayerAdded:connect(function(plr) -- Event of when a player enters
	repeat wait() until plr.Character -- Waits until the character exists
	local Animation = plr.Character.Animate:Clone() -- Saving the Animate script
	plr.Character = NewCharacter -- Changing the player's character
	NewCharacter.Parent = workspace -- Changing the character's parent from nil to workspace
	Animation.Parent = NewCharacter -- Adding the Animate script to the new character
end)

Hope this helps with the understanding! If you got any questions, feel free to ask!

2 comments

0

It doesn't seem to work when I test it in play solo. What do you think the problem is?

0

Most likely the "Animate" script. "Animate" is a recent name for the animation scripts by ROBLOX. Try finding the real name and change "Animate" to the actual name.

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