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

Change player into model onentered?

So i'm working on a game where I want you to automatically onentered change the player into a model i made which i inserted an humanoid and head object into.

I was wondering if there is a way to pull this off? basically what i'm trying to say is how to change the player to a different object. I've been looking this up over and over and found nothing. :/

Model. http://i.imgur.com/CCFfVzH.png

7 comments

0

What's your script so far?

0

Here is the script. http://i.imgur.com/Rlvyeye.png

0

Did you set your Part0 and Part1 to the corresponding body parts as shown in the default Robloxian character object? There's DaMrNelson's plugin to do that.

0

What is DrNelson's plugin?

0

It works i finally got it to work thanks sooooooooo much :D your the best!

0

You're welcome. :D

1 answer

✓ Accepted answer

SHORT ANSWER: Upon entering the server, you could redefine the Character property in the Player instance.

LONG ANSWER: There are some guidelines you may need to follow to make a functional Character object.

SCRIPT

  • You need a server script with .PlayerAdded and .CharacterAdded, because this will be the fundamental element to transform the Character object.
-- Ideally, you should put this in game.ServerScriptService.
game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		-- This is where the magic happens.
	end)
end)
  • I've seen scripts where it does the transformation itself (i.e. re-positions and re-sizes the body parts for you), but I find it easier to make a base model for the Character object first and store it somewhere (ideally, game.ServerStorage).

CHARACTER

  • As mentioned before, store the Character object in a storage instance (skip this if you're just going to create a script for the transformation). Anchor all of the parts.

  • In order to sustain the life of your Character object, a head/torso MUST be connected (Motor6D) and a HumanoidRootPart MUST be present. Refer to the default Robloxian Character object and see where the Motor6D joint objects connect to.

  • In my experience, keeping a Humanoid object in the Character object in Studio never worked out, as I keep dying. So in your script, create a new Humanoid object onto the Character.


Now all you have to do is make a spawn point for your character (with CFrame), rename the Character object every time it spawns, and then you're pretty much done.

This is how you redefine a Character object, add the Humanoid object in, and rename your character:

-- If your Character object is in game.ServerStorage
newCharacter = game.ServerStorage.YourCharacterObject:Clone()
newCharacter.Parent = workspace
newCharacter.Name = Player.Name
Player.Character = newCharacter

Humanoid = Instance.new("Humanoid", newCharacter)

newCharacter.Archivable = false

3 comments

0

Hello, your amazing script seems to be working but my new player seems to die and i can't seem to know if i got the objects right. :/

0

The objects in the model. http://i.imgur.com/lo41fv1.png

0

It works it works! your the best I really mean it! :D

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