Empty
Empty
Empty
Workspace (工作區) 是遊戲中所有物理部分存在的主要區域。這包括玩家可以看到和互動的物體,如角色、建築物、工具和其他項目。
Empty
Empty
Empty
它像是遊戲的“世界”,包含構成遊戲的所有項目和環境。伺服器和玩家的電腦(客戶端)都可以看到和互動 Workspace (工作區) 中的物體。
Roblox Studio
Empty
Empty
Empty
local workspace = game:GetService("Workspace")
local cube = workspace:FindFirstChild("Cube")
if cube and cube:IsA("Part") then
print("Found the part named 'Cube'")
cube.BrickColor = BrickColor.new("Bright red")
else
print("Part named 'Cube' not found in the workspace or it is not a Part")
end
Roblox Studio