I'm trying to make a gun without a local script but it keeps saying mouse is a nil value.
Here is my script.
local tool = script.Parent.Parent
repeat wait() until tool.Parent.Name ~= "Backpack"
if tool.Parent.Name ~= "Backpack" then
print("Equipped")
local user = tool.Parent
print("Character")
local player = game.Players:GetPlayerFromCharacter(user)
print("Player")
local mouse = player:GetMouse()
print("Got mouse!")

3 comments
Since you're using a LocalScript, you can just get the player through the Players Service using "game.Players.LocalPlayer" instead of getting the player through the tool.
No im not using a local script
if you want to get the player's mouse you need to do that in a local script according to the roblox developer hub https://developer.roblox.com/en-us/api-reference/function/Player/GetMouse