Hi, I’m trying to make a StarterCharacter restricted to a certain player, so that when that specific player loads in, they will have the custom character while others don’t.
I wanna go from this:
To this:
Any help is appreciated, thanks!
Hi, I’m trying to make a StarterCharacter restricted to a certain player, so that when that specific player loads in, they will have the custom character while others don’t.
I wanna go from this:
To this:
Any help is appreciated, thanks!
You can use a script to look for your user id when you join and just give yourself the custom character.
So it should look something like this:
local playerId = yourIdHere
game.Players.PlayerAdded:Connect(function(player)
if player.UserId == playerId then
local customCharacter = ServerStorage.Character:Clone()
customCharacter.Name = "StarterCharacter"
customCharacter.Parent = game:GetService("StarterPlayer")
wait()
Player:LoadCharacter()
end)
You’ll place your character in ServerStorage and name it Character, then just replace the ID placeholder with your user id. I got this from memory, so if there’s a mistake here please let me know.
You got to add a connect the to PlayerAdded Event
Yeah that’s my bad, as @flapjakes said all that it needs is the connection.
I’ve edited the code above to include said change, and again I apologize for overlooking that before.
my team already amde a working script btu doesnt work with a startercharacter
game.Players.PlayerAdded:Connect(function(player)
local playerId = 178196501
if player.UserId == playerId then
local customCharacter = game.ServerStorage.HANK:Clone()
customCharacter.Name = "StarterCharacter"
customCharacter.Parent = game:GetService("StarterPlayer")
wait()
player:LoadCharacter()
end
end)
Right. Now that I’ve had the opportunity to sit down and test everything/make a couple changes, the code below works perfectly for me. Just ensure you have the character animation script already placed in your custom character model and you’ve set the primary part of the model. Hope this helps, @KCavileer
local playerId = [youridhere]
game.Players.PlayerAdded:Connect(function(player)
if player.UserId == playerId then
local customCharacter = game.ReplicatedStorage:WaitForChild("StarterCharacter"):Clone()
customCharacter.Name = "StarterCharacter"
customCharacter.Parent = game:GetService("StarterPlayer")
wait(.1)
player:LoadCharacter()
end
end)
Does it work with a already put startercharacter?
No, the point of this topic was to only add a StarterCharacter for a certain player, which it what this script accomplishes.
Hmmmm okay…
(adding text here to able to post)
You’re free to make a separate topic about your issue but it shouldn’t be very hard to do.
well… ive made 3 topics already and 1 of them to make it so that startercharacter scripts go inside of the skin Why wont startercharacter scripts load?
if i put a startercharacter in for every other player will this mess the script up?
That’s simple!
Player.Character = CustomCharacter
OBS: The camera will be born buggy and the Animation will not play, it will take work but this is a way to do it, if not you can remove all items, colors and etc from the player’s Skin and get everything from the CustomCharacter, clone and put in the Player.