Alright, so I'm a modeler thats just trying to put together a script that makes it so only certain people can have a model as their starter character but its not working and I dont know why, any help?
local players = {"Voxoc"}
game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:connect(function(chr) for i = 1, #players do if players[i] == plr.Name then local object = game.Workspace["Armored Titan"]
local clonedObject = object:Clone() clonedObject.Name = "StarterCharacter" clonedObject.Parent = game.StarterPlayer end end end) end)
--[[ The following script has been tested in a case with more than one player and different names This is a Server script (regular script) inside ServerScriptService You can rename the players and the model at will The StarterCharacter you want to have is placed in a folder inside of ServerStorage (More in the script) The character has to be unanchored, I didn't manage to make it unanchorable by script !! The model of the starter Character needs a PrimaryPart to be set !! --]] local CharacterModel = game.ServerStorage:FindFirstChild("StarterCharacters").EEEsus local PlayersToTransform = {"bostaffmanbulgaria1", "Player1", "Player2"} game.Players.PlayerAdded:Connect(function(player) for i,v in pairs(PlayersToTransform) do if game.Players:FindFirstChild(v) then if not game.StarterPlayer:FindFirstChild("StarterCharacter") then local NewStarterCharacter = CharacterModel:Clone() NewStarterCharacter.PrimaryPart = NewStarterCharacter:FindFirstChild("HumanoidRootPart") NewStarterCharacter.Name = "StarterCharacter" NewStarterCharacter.Parent = game.StarterPlayer end end end end)