rojo/.cursor/rules/roblox/reference/engine/classes/StarterPack.yaml
2026-02-02 12:08:47 -06:00

51 lines
2 KiB
YAML

# This file is automatically generated. Please don't edit it manually.
# To submit a bug report on the content, see
# https://devforum.roblox.com/c/bug-reports/documentation-issues/72
name: StarterPack
type: class
memory_category: Instances
summary: |
A service-level container whose contents are copied into each player's
`Class.Backpack` when the player spawns. It is generally used to hold `Tools`,
but is sometimes used to hold `Class.LocalScript|LocalScripts` to ensure that
each player gets a copy.
description: |
A service-level container whose contents are copied into each player's
`Class.Backpack` when the player spawns. It is generally used to hold `Tools`,
but is sometimes used to hold `Class.LocalScript|LocalScripts` to ensure that
each player gets a copy.
When a player's character spawns, the contents of the StarterPack and their
`Class.StarterGear` are copied into their `Class.Backpack`. Once a character
dies, the `Class.Backpack` is removed and a new one is created -- populating
it using the contents of `Class.StarterPack` and `Class.StarterGear`.
The StarterPack is used to determine a set of `Class.Tool|Tools` that _all_
players will spawn with. If a developer wants to ensure that certain
`Class.Tool|Tools` are available to specific players, then they will need to
parent the `Class.Tool|Tools` directly to the player's `Class.Backpack`
instead.
Note: while normally the contents of `Class.StarterPack` are predefined, the
contents can be changed while the game is running by adding and removing
`Class.Tool|Tools` accordingly. These updates will pass onto a player's
backpack when they respawn and their backpacks are reloaded. Changes to the
StarterPack should be made by the server.
A tool can be added to the StarterPack using the following code.
Tool.Parent = game:GetService("StarterPack")
code_samples:
- Empty-StarterPack
inherits:
- Instance
descendants: []
tags:
- NotCreatable
- Service
deprecation_message: ''
properties: []
methods: []
events: []
callbacks: []