How do I get the StarterCharacterScripts from the server?

I’m attempting to put a script into the player’s StarterCharacterScripts.

local respawnArmor = script.Parent.armor_Football:Clone()
respawnArmor.Parent = plr:FindFirstChild("StarterPlayer"):FindFirstChild("StarterCharacterScripts")
respawnArmor.Enabled = true

However, this doesn’t seem to work. How do I put a script into a given player’s StarterCharacterScripts? Or is there a better way of going about this?

1 Like
local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		local Armor = script.Parent.armor_Football:Clone()
		Armor.Parent = Character -- Character = StarterCharacterScripts
		Armor.Enabled = true
	end)
end)
Client
-- client script
local plr = game.Players.LocalPlayer
local respawnArmor = script.Parent:WaitForChild("armor_Football"):Clone()
respawnArmor.Parent = plr:WaitForChild("StarterPlayer"):WaitForChild("StarterCharacterScripts")
respawnArmor.Enabled = true

Server
-- server script
local player = game.Players.PlayerAdded:Wait()

if player then
    local respawnArmor = script.Parent:WaitForChild("armor_Football"):Clone()
    respawnArmor.Parent = player:WaitForChild("StarterPlayer"):WaitForChild("StarterCharacterScripts")
    respawnArmor.Enabled = true
end