Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

StarterGear isn't a valid member of player?

I have a script that gives you your saved weapons when you rejoin the game, but It says that StarterGear isnt a valid member of player even though playerstats is a member of player and works but startergear is a child of player and wont work. I tried it with backpack and still didnt work.

function PlayerJoined(player)
	local Primary = player.PlayerStats.PrimaryTool
	local Secondary = player.PlayerStats.SecondaryTool
	game.ServerStorage[Primary.Value]:Clone().Parent = player.StarterGear
	game.ServerStorage[Primary.Value]:Clone().Parent = player.Backpack
	game.ServerStorage[Secondary.Value]:Clone().Parent = player.StarterGear
	game.ServerStorage[Secondary.Value]:Clone().Parent =player.Backpack
end

game.Players.ChildAdded:connect(PlayerJoined)

4 comments

0

..I know...

0

NVM FIXED!!!!!

1

For anybody wondering, the link I posted went to a question by GalaxyFPS_Studios, which was almost the exact same question, if you take a look at the two question id's, you can see that his other one was 7 places down on the newest questions list. And then he deleted it.

1 answer

StarterGear is not a member of the player by default, unless you add it in manually. If you want a tool/weapon to be added to the player's backpack when the join/respawn, you'll need to put it in the StarterPack group, which can be found in the Explorer window or game.StarterPack in a script.

This discussion is preserved as it was. New answers, comments, and votes are closed.