Workspace (工作區)

Workspace (工作區) 是遊戲中所有物理部分存在的主要區域。這包括玩家可以看到和交互的物體,如角色、建築物、工具和其他項目。

它像是遊戲的“世界”,包含構成遊戲的所有項目和環境。伺服器和玩家的電腦(客戶端)都可以看到和互動 Workspace (工作區) 中的物體。

Image 1
Roblox Studio
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
Image 1
Image 2
Roblox Studio

如果你覺得這個教程對你有幫助,並且願意支持我的工作,請考慮請我飲杯咖啡。

非常感謝你的支持!

請我飲杯咖啡