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

How do I make it so I have a StarterCharacter for one specific player? [closed]

Asked by 5 years ago

So basically, usually I would do is place the morph that I made in starter character and every time someone else or I joins the server they would spawn in as that morph I made. I would like to make different morphs that only certain players (via name) spawn in as. Wether I do that by naming the starter character or a script, how would I go about doing this?

0
Why not just make a morph script that changes there character when they respawn? elitekiller2342 87 — 5y
0
How would I do that? JayShepherdMD 147 — 5y

Closed as Not Constructive by zblox164, Programical, and SerpentineKing

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Don't forget this is not a request site and not everybody will offer you help after you don't show an attempt of writing the script first.

So make sure you read every step in order for you to learn from this.

What you want to do is have a script in ServerScriptService to start this out.

Now we want to find the StarterCharacter that you have and you want to place your StarterCharacter in a folder that has it's own unique name in ReplicatedStorage. Placing it inside a named folder will allow us to be able to tell it apart from the other StarterCharacters you will place there (I believe you said you wanted multiple).

For our example we will name this folder "JayShepherdMD". We will then identify it in our Server script.

local Avatar = game:GetService("ReplicatedStorage"):FindFirstChild("JayShepherdMD").StarterCharacter

Now we will do our function

game.Players.PlayerAdded:Connect(function(player)
  if player.UserId == 59942169 then --Using your user Id
    local PlayerAvatar = Avatar:Clone()
    PlayerAvatar.Parent = game:GetService("StarterPlayer")
    PlayerAvatar.Name = "StarterCharacter"
    wait(0.1)
    Player:LoadCharacter() 
    end
end)

Where we do

game.Players.PlayerAdded:Connect(function(player)
  if player.UserId == 59942169 then --Using your user Id

We are finding if a new player has been added to the game. Once one has been found it makes sure it has the correct Id of the player that you want it to be.

And where we do

local PlayerAvatar = Avatar:Clone()
PlayerAvatar.Parent = game:GetService("StarterPlayer")
PlayerAvatar.Name = "StarterCharacter"

We are making a clone of the original model and placing it in StarterPlayer because that is where the StarterCharacter needs to be in order to give the player that appearance. And although the model is already named "StarterCharacter" I still name it twice just in case.

And therefore your final script should be.

local Avatar = game:GetService("ReplicatedStorage"):FindFirstChild("JayShepherdMD").StarterCharacter

game.Players.PlayerAdded:Connect(function(player)
  if player.UserId == 59942169 then --Using your user Id
    local PlayerAvatar = Avatar:Clone()
    PlayerAvatar.Parent = game:GetService("StarterPlayer")
    PlayerAvatar.Name = "StarterCharacter"
    wait(0.1)
    Player:LoadCharacter() 
    end
end)

Thank you, if it doesn't work please tell me where I went wrong.

0
Also I forgot to mention where I go "Player:LoadCharacter()" After the wait I'm making sure that the character is reloaded because then your character won't update. songboy50 77 — 5y
0
Thank you. JayShepherdMD 147 — 5y
0
Np :D songboy50 77 — 5y
Ad