Im doing a place tool which places blocks, but i can't define where somebody clicked, so i dont know where can i place the block. Here is the script.
local Tool = script.Parent
Tool.Equipped:connect(function(Mouse)
Mouse.Button1Down:connect(function(location)
local part = Instance.new('Part')
part.Parent = workspace
part.Anchored = true
part.CFrame = location
local sbox = Instance.new("SelectionBox")
sbox.Name = "sbox"
sbox.Adornee = part
sbox.Parent = part
end)
Mouse.Button1Up:connect(function()
game.Workspace.Part.sbox:remove()
wait(30)
game.Workspace.Part:remove()
end)
end)

3 comments
I should point out that Hit is a variable, not a function, and so the parentheses are not necessary. Hit is also a CFrame, so keep that in mind. Finally, the mouse passed to the event will work just fine.
Oops, just noticed that I added parentheses on accident. Thanks for cathcing it
i changed the script into local and changed player into game.Players.LocalPlayer and did some things but then now it dosent give any error.