How do I make a StarterCharacter that only I spawn as?

  1. What do you want to achieve? A StarterCharacter that only I spawn as, if someone else joins they wont have it as well.

  2. What is the issue? I’ve tried using different scripts that I didn’t make but they didnt work so I tried making my own, but that doesn’t work, here is an image below of what I made, but it failed.

  1. What solutions have you tried so far? using other peoples scripts and trying to make it myself, as shown above.

The script is in ServerScriptService, its a regular/server script.

If anyone sees this, help or clarity on how to do this would be greatly appreciated.

2 Likes

Move the starter character to the replicatedstorage and have the script clone it into starterplayer for you and you only.

okay, Im not quite sure how to do that but Ill try, Ill let you know if it works or not.

I tried but it doesnt work, Im not quite sure how to make it so its in starterplayer only for me, I could use a localscript but then it would only show for me and I want it visible for other players, so I cant use a localscript.

local playerId = 1366889120

local customCharacter = game.ReplicatedStorage.Owner:WaitForChild(“OwnerCharacter”):Clone()

game.Players.PlayerAdded:Connect(function(player)
if player.UserId == playerId then
customCharacter.Parent = game.StarterPlayer
player.Character = customCharacter
player:LoadCharacter()
end
end)

Sorry, I’m new to scripts with StarterCharacters.

The code you provided should also work from a server script.

Running on the server will probably allow everyone to see your character.

Don’t forget to test if you still have the character on respawn.

I tried it in a server script but it doesnt work, I dont get the character when I first join in, and when I reset it doesnt let me respawn somehow.

Have you tried setting the customCharacter.Parent to workspace?

yeah but it doesnt work either, I dont even see its name in workspace

game.Players.PlayerAdded:Connect(function(player)
if player.UserId == playerId then
customCharacter.Parent = workspace
player.Character = customCharacter
player:LoadCharacter()
end
end)

also for some reason when I die I dont respawn, so it leads me to believe that it sorta worked.

robloxapp-20221223-0913028.wmv (1.0 MB)

image

When you use :Clone() on an object, that object gets parented to nil, so before you set the character, parent the character to the workspace.

Using loadCharacter pretty much resets your character to your original Roblox character, so don’t do that

still nothing, no name in workspace and my character is the same

1 Like

PlayerAdded won’t work for you as you’re already in-game, you need to find a different way of doing that.

Edit: I didn’t see that the script was in ServerScriptService. My bad.

Well then are you sure that your “ownerCharacter” is rigged properly?

I don’t think the rigs would matter as it’s not even in workspace.

yeah, Ill post an image of it for you here.

everything else there is weldconstrainted on

Before everything, disable the script for now, can you try making a script that ONLY clones the character in replicatedstorage & moves it to workspace?

okay, it spawned in

local char = game.ReplicatedStorage.Owner.OwnerCharacter:Clone()

char.Parent = workspace

Now, since you know that part of the code works, try adding the other part.

Also, here’s a tip for when you use the devforum: type ``` before and after any code. It’s called a codeblock and it is really helpful when giving scripts.

Edit: you can also click on the </> button on the top of the writing area.

alr so I tested if its something to do with the playeradded but its not and it spawns in fine with the code below, I think its trying to parent it to the player which doesnt work.

robloxapp-20221223-0932519.wmv (130.4 KB)


local playerId = 1366889120

game.Players.PlayerAdded:Connect(function(player)
	if player.UserId == playerId then
		char.Parent = workspace
	end
end)

Does the character have a root part & a humanoid?