I dont need a full script or anything. I would like to know how to exactly spawn a brick at the given spot a player clicks.
1 | player = game.Players.LocalPlayer |
2 | mouse = player:GetMouse() |
3 |
4 | mouse.Button 1 Down:connect( function (click) |
5 | -- stuf? |
6 | end ) |
Use mouse.Hit, it returns the CFrame position value of the mouse, then you can clone the part to that CFrame position.
1 | player = game.Players.LocalPlayer |
2 | mouse = player:GetMouse() |
3 |
4 | mouse.Button 1 Down:connect( function (click) |
5 | x = Instance.new( "Part" , game.Workspace) |
6 | --Part customization stuff |
7 | x.CFrame = mouse.Hit |
8 | end ) |