Script:
function make(pos)
local g = Instance.new("Part")
g.Parent = workspace
g.BrickColor = BrickColor.new("Cork")
g.Size = Vector3.new(4,4,4)
g.CFrame = pos
end
script.Parent.Parent.Activated:Connect(function()
local mouse = game.Players:GetPlayerFromCharacter(script.Parent.Parent.Parent):GetMouse()
make(mouse.Hit)
end)
The problem is that every time this script runs on line 11 it causes an index nil for some reason. How do I fix this?

5 comments
this is a normal script not local btw
Where is this script placed
startergui
I'd recommend using remote events for this.
god i learned how to use remote events and learned that hit is cframe