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:

local uis = game:GetService("UserInputService")
local p = game.Players.LocalPlayer
local character = p.Character
local m = p:GetMouse()

uis.InputBegan:Connect(function(keyCode)
    if keyCode.keyCode == Enum.KeyCode.B then
        local newpart = Instance.new("Part", workspace)
        newpart.Name = "test"
        newpart.Position = m.Hit
    end
end)

Answer this question