so im having some issues, this script is a regular script in a tool it keeps saying that mouse is a nil value
heres the code that i made
local player = script.Parent.Parent.Parent
local mouse = player:GetMouse()
script.Parent.Activated:Connect(function()
local kaboom = Instance.new("Explosion",workspace)
kaboom.Position = mouse.Hit.Position
end)

3 comments
Where is the script located?
Also is this script local?
The script has to be local, and you can set player as game.Players.LocalPlayer