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

how to create a part with same position as mouse.hit.p?

Asked by
Maaruv -3
6 years ago

i was wondering how to create a part with the same location as mouse.hit.p that's invisible

1 answer

Log in to vote
0
Answered by
tantec 305 Moderation Voter
6 years ago

You would do this

Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()

-- made it so you have to click in order for it to happen
Mouse.Button1Down:connect(function()
if Mouse.Target ~= nil then
part = Instance.new("Part", game.Workspace)
part.Transparency = 1
part.CFrame = CFrame.new(Mouse.Hit.x,Mouse.Hit.y,Mouse.Hit.z)
end
end)

I done it so that you need to left click your mouse in order for it to happen, if you wish for the part to be visible change the transparency to 0.

0
that helped thanks! Maaruv -3 — 6y
Ad

Answer this question