I have a dumb question… I am currently using a script to auto-load in tools for those who own gamepasses. When I address the player at the beginning:
local function onPlayerAdded(player)
Everything works out fine. Although later addressing the player variable to clone the item into the player’s StarterPack, I receive an error or no tools are transplanted. When attemping to put the tool into the player’s starter pack, the line of code looks as so:
game.Lighting.HandlessSegway:Clone().Parent = player.StarterPack
Any tips? And sorry if I didn’t make this clear, it was hard to word.
The StarterPack probably doesn’t exist yet. Try player:WaitForChild("StarterPack").
Also, using Lighting as a storage service is an awful idea. Use ServerStorage instead.
1 Like
Alright no errors this time, just no tools show when joining. I also tried resetting to see if I would spawn with them, but no sign.
The problem here is that there is no StarterPack object within the player. The object you’re looking for is called Backpack.
Your code should look like this:
game.Lighting.HandlessSegway:Clone().Parent = player.Backpack
1 Like
And/or maybe he’s thinking of StarterGear
Yea I think you are correct.
Maybe. Things in the backpack, obviously, are what they currently have available to use, and StarterGear is stuff that they respawn with. Not everything in the backpack is necessarily in StarterGear.