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

[SOLVED] How would I make a script that makes new part with the position of the plr mouse?

Asked by 4 years ago
Edited by DeceptiveCaster 4 years ago

I'm really confused, I have no idea how to do it, could anyone help me out?

Code:

01local uis = game:GetService("UserInputService")
02local p = game.Players.LocalPlayer
03local character = p.Character
04local m = p:GetMouse()
05 
06uis.InputBegan:Connect(function(keyCode)
07    if keyCode.keyCode == Enum.KeyCode.B then
08        local newpart = Instance.new("Part", workspace)
09        newpart.Name = "test"
10        newpart.Position = m.Hit
11    end
12end)

Answer this question