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