How to create a part with script in roblox srudio

-- Step 1: Create a new part
local newPart = Instance.new("Part")

-- Step 2: Set the properties of the part
newPart.Size = Vector3.new(10, 5, 2)
newPart.Position = Vector3.new(0, 5, 0)
newPart.Anchored = true
newPart.BrickColor = BrickColor.new("Bright red")

-- Step 3: Parent the part to the Workspace
newPart.Parent = game.Workspace

-- Step 4: Create a script
local newScript = Instance.new("Script")

-- Step 5: Write your script code
newScript.Source = [[
    -- Your script code goes here
    print("Hello, Roblox!")
]]

-- Step 6: Parent the script to the part
newScript.Parent = newPart