Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

StarterGear isn't a valid member of player?

Asked by
Galicate 106
6 years ago

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)
0
..I know... Galicate 106 — 6y
0
NVM FIXED!!!!! Galicate 106 — 6y
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. theCJarmy7 1293 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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.

Ad

Answer this question