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

How to morph character when he joins and respawns?

Asked by 9 years ago

So this might be a horrible question. However, I have never tinkered with character's appearances ever before so what I would like to know is how would I morph a character with my script once he joins the game and if he dies, morph him again.

If there is no possible way of morphing him when he dies, then I'll make sure that my game won't kill the player.

I've already started it, but I have no idea where to go next.

game.Players.PlayerAdded:connect(function(plr)
    plr.CharacterAdded:connect(function(char)
        wait()

    end)
end)

2 answers

Log in to vote
0
Answered by 9 years ago

Actually, I think the best solution is something I've done in the past.

Take a free model morpher that has you morph into something when you touch a block. Take the function that is run when the block is touched, and put that above your code above that detects entry of the player.

Call the function directly and pass into it Character.Head or some part of the player in order to satisfy the function's need to detect a player part touching the block. For our purpose, we are detecting a touch event, but are "hot wiring" it to be called upon spawn.

Make sure that models needed for the function are included and put in the appropriate places for the function to work - you might just copy your own model in place of whatever is in the free model, or reorganize the script the way you want it to point to where you have your models saved.

Anyway, that's my advice - if you try this and have more questions, repost with some more script, and I'm sure someone here will be able to help you.

-JasonTheOwner

0
Thank you. This was what I was looking for. InfraredChasm 35 — 9y
Ad
Log in to vote
0
Answered by
Validark 1580 Snack Break Moderation Voter
9 years ago

In order to know where to go next in scripting you have to know what it is, exactly, what you are intending to do. If you can't say, you can't make a computer do it.

Mentally, you should go through a process like this:

1) What do I want to make?

A morph script

2) What will it do? What will it look like?

It will change the clothing of the player when they join the game.

3) How can I script this?

You already got started on this:

game.Players.PlayerAdded:connect(function(plr) --When a player joins
    plr.CharacterAdded:connect(function(char) --When that player spawns
        -- Now, we want to change the Clothing of the Player.
    -- We already have the character referenced as "char"
    -- Let's change the Shirt and Pants Texture (this assumes they already have a shirt and pants on)


    char.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=227457580"
    char.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=227458244"

    --Take it from here!

    end)
end)
0
I'm going for a custom model. However, your answer is going to help me out if I ever want to create something like that. Thank you! InfraredChasm 35 — 9y

Answer this question