Instance.new()?Instance.new() is used to create new objects (parts, lights, sounds, scripts, etc.) with code.
lua
CopyEdit
local part = Instance.new("Part")
This creates a new Part, but it doesnβt appear in the game world until you parent it to something.
lua
CopyEdit
local part = Instance.new("Part")
This adds it to the game world (like putting it in Workspace).
lua
CopyEdit
part.Parent = game.Workspace
OR create and parent it in one line:
lua
CopyEdit
local part = Instance.new("Part", game.Workspace)
Set its properties (position, size, color, etc.)
lua
CopyEdit
part.Anchored = true
part.Position = Vector3.new(0, 10, 0)
part.Size = Vector3.new(4, 1, 4)
part.Material = Enum.Material.Neon
part.Color = Color3.new(1, 0, 0) -- red