So 1 or 2 weeks ago I had trouble scripting a stamper tool, what I want to do is that when you have to tool and you click on the floor it will make a brick. Heres the script so far:
function onClicked(playerWhoClicked) local brick = Instance.new("Part", game.Workspace) -- Creating the brick, and placing it into the Workspace brick.Name = "NewBrick" -- This name has to correspond with the name of your brick on the map brick.Size = Vector3.new(10, 10, 10) -- This is the size to which you want to change your brick end script.Parent.ClickDetector.MouseClick:connect(onClicked)
I also thought of putting a sample brick on lighting and when you click it will clone the brick and put it on workspace I will work on that later.
Why is this in a clickdetector if you want to make the part it should be in a tool? Use mouse.Hit to place the part. Example:
tool=script.Parent tool.Equipped:connect(function(mouse) --Fires event when tool is equipped mouse.Button1Down:connect(function() player=game.Players:GetPlayerFromCharacter(tool.Parent) --Gets player local part=Instance.new("Part",Workspace) --Makes a new part in Workspace part.FormFactor="Custom" --Sets part`s formfactor to custom to make a certain size part.Size=Vector3.new(10,10,10) --Sets size part.Position=mouse.Hit.p --Uses mouse.Hit.p (3D CFrame position) to position the part part.Name=player.Name.."_Brick" --Makes the part`s name the player`s name then _Brick end) end) --Ends event
This is just an example, but if you want to use it it`s okay just edit it, put it in a local script in order to work.