function onTouch()
local Robux = Instance.new("Part")
Robux.Name = "Robuck"
Robux.BrickColor = BrickColor.new("Bright green")
Robux.Size = Vector3.new(1, 0.4, 2)
Robux.TopSurface = "Smooth"
Robux.BottomSurface = "Smooth"
Robux.Position = game.Workspace.SpawnPart.Position
end
game.Workspace.Button.Touched:connect(onTouch)
COMMUNITY QUESTION
What's wrong with this script???
2 answers
function onTouch()
Robux = Instance.new("Part")
Robux.Name = "Robuck"
Robux.BrickColor = BrickColor.new(0,0,255)
Robux.Size = Vector3.new(1, 0.4, 2)
Robux.TopSurface = "Smooth"
Robux.BottomSurface = "Smooth"
Robux.CFrame = game.Workspace.SpawnPart.CFrame
end
game.Workspace.Button.Touched:connect(onTouch)
You have to say where to spawn it,
Like this:
function onTouch()
local Robux = Instance.new("Part")
Robux.Name = "Robuck"
Robuck.Parent=game.Workspace
Robux.BrickColor = BrickColor.new("Bright green")
Robux.Size = Vector3.new(1, 0.4, 2)
Robux.TopSurface = "Smooth"
Robux.BottomSurface = "Smooth"
Robux.Position = game.Workspace.SpawnPart.Position
end
game.Workspace.Button.Touched:connect(onTouch)
For line 08 you CAN do
Robuck.Position=Parent.SpawnPart.Position
I THINK that should solve you problem.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
spawn a new brick
What is "SpawnPart"? Is it the same size as the new Part you are intending to create?
Well, BrickColor = BrickColor.new won't work, try Robux.BrickColor = Color3.new(0,0,255) and erase 'local'
The BrickColor.new("Bright green") is completely vaild. Erasing local will not help in this situation. What will help is any information on what happens and if there is any output.