I have a script that is supposed to fire a projectile out of a parent tool, however the script ends when I try to define the players mouse
local plr = script.Parent.Parent:findFirstChild("Humanoid")
local player = game.Players:GetPlayerFromCharacter(plr)
local mouse = player:GetMouse()
This is what I have, however it doesn't work.
Alternatively I have tried
local plr = script.Parent.Parent
local name = plr.Name
local player = game.Players.name
local mouse = player:GetMouse()
The tool parent ladder is
script > tool > players backpack/player(when held)
Any ideas on how to fix this?

3 comments
Is there any reason why you're using a serverscript instead of a localscript? Because a localscript would be a much better type of script to use for your situation
You can't
I am using a serverscript because the tool spawns a solid block that I want to be able to interact with all players, not just the client player