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)
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.