Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

So, how would I make a tool that creates a brick at the spot I click?

Asked by
yurhomi10 192
10 years ago

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.

player = game.Players.LocalPlayer
mouse = player:GetMouse()

mouse.Button1Down:connect(function(click)
-- stuf?
end)

1 answer

Log in to vote
1
Answered by
Sublimus 992 Moderation Voter
10 years ago

Use mouse.Hit, it returns the CFrame position value of the mouse, then you can clone the part to that CFrame position.

player = game.Players.LocalPlayer
mouse = player:GetMouse()

mouse.Button1Down:connect(function(click)
    x = Instance.new("Part", game.Workspace)
    --Part customization stuff
    x.CFrame = mouse.Hit
end)

0
Sweet thanks so much! yurhomi10 192 — 10y
0
No problem! Sublimus 992 — 10y
Ad

Answer this question