mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-24 06:24:06 +00:00
rules
This commit is contained in:
parent
a9b4f8e83b
commit
e6efc04756
8494 changed files with 495610 additions and 0 deletions
53
.cursor/rules/roblox/reference/engine/classes/Backpack.yaml
Normal file
53
.cursor/rules/roblox/reference/engine/classes/Backpack.yaml
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
# 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: Backpack
|
||||
type: class
|
||||
memory_category: Instances
|
||||
summary: |
|
||||
A container object that holds a player's inventory. Any `Class.Tool` in a
|
||||
player's Backpack will be displayed in their inventory at the bottom of their
|
||||
screen.
|
||||
description: |
|
||||
A container object that holds a player's inventory. Any `Class.Tool` in a
|
||||
player's Backpack will be displayed in their inventory at the bottom of their
|
||||
screen. Selecting `Class.Tool|Tools` from the inventory will equip the
|
||||
`Class.Tool`, moving it from the Backpack to the player's character.
|
||||
|
||||
The Backpack can also store `Class.Script|Scripts` and
|
||||
`Class.LocalScript|LocalScripts`, which run when placed in a player's
|
||||
Backpack.
|
||||
|
||||
When a player's character spawns, the contents of the `Class.StarterPack` and
|
||||
their `Class.StarterGear` are copied into their Backpack. Once a character
|
||||
dies, the Backpack is removed and a new one will be created -- populating it
|
||||
with the contents of `Class.StarterPack` and `Class.StarterGear`.
|
||||
|
||||
Roblox provides an interface for a player to access their backpack and
|
||||
inventory by default at the bottom of the screen. If a developer wishes to
|
||||
disable the default Roblox backpack GUI and replace it with their own, they
|
||||
may do so using `Class.StarterGui:SetCoreGuiEnabled()`.
|
||||
|
||||
The Backpack can be accessed from both the client and the server.
|
||||
|
||||
```lua
|
||||
local Players = game:GetService("Players")
|
||||
|
||||
-- Accessing Backpack from a Server Script:
|
||||
local backpack = Players.PlayerName.Backpack
|
||||
|
||||
-- Accessing Backpack from a LocalScript:
|
||||
local backpack = Players.LocalPlayer.Backpack
|
||||
```
|
||||
code_samples:
|
||||
- Backpack-Give-Tool
|
||||
inherits:
|
||||
- Instance
|
||||
descendants: []
|
||||
tags: []
|
||||
deprecation_message: ''
|
||||
properties: []
|
||||
methods: []
|
||||
events: []
|
||||
callbacks: []
|
||||
Loading…
Add table
Add a link
Reference in a new issue