Empty
Empty
Empty
Roblox 中的背包是一個系統,用於在遊戲過程中儲存工具和物品。它允許玩家直接從他們的庫存中存取、裝備和使用這些工具。
Empty
Empty
Empty
local Players = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")
local function onPlayerAdded(player)
player.CharacterAdded:Connect(function(character)
local conditionMet = player:FindFirstChild("SomeCondition")
if conditionMet then
local tool = ServerStorage:FindFirstChild("Sword")
if tool then
local toolClone = tool:Clone()
toolClone.Parent = player:WaitForChild("Backpack")
end
end
end)
end
Players.PlayerAdded:Connect(onPlayerAdded)