So ive inserted a gun modeled from blender, put a handle part into the tool, and scripted with filtering enabled, yet when I try to equip the tool it simply does not show.
Note I also got a error:
Players.GoodkidMad.Backpack.m1911.Scripts.Main:25: attempt to index local 'mouse' (a nil value)
-- Variables
local tool = script.Parent.Parent
local hole = tool.barrel
local handle = tool.Handle
local debounce = true
local config = tool.Config
local ammo = config.Ammo
local maxammo = config.MaxAmmo
local dmg = config.Damage
local allowtrace = config.AllowTracing
local clips = config.Clips
local range = config.Range
local plr = game:GetService("Players").LocalPlayer
local cooldown = config.CoolDown
-- Events
tool.Equipped:Connect(function(mouse)
tool.Activated:Connect(function(mouse)
if debounce then
-- Doesnt Allow Spam
debounce = false
-- Ray Get, & Set
mouse.Button1Down:connect(function()
local ray = Ray.new(hole.CFrame.p (mouse.hit.p - hole.CFrame.p) * range.Value)
local hit, position = workspace:FindPartOnRay(ray, plr.Character, false, true)
if allowtrace.Value == true then
-- Make part
local trace = Instance.new("Part", workspace)
trace.Material = Enum.Material.Plastic
trace.BrickColor = BrickColor.new("Really black")
trace.CanCollide = false
trace.Anchored = true
trace.Locked = true
trace.Transparency = 0.2
-- Show Direction
local distance = (hole.CFrame.p - position).magnitude
trace.Size = Vector3.new(0.22, 0.1, distance)
trace.CFrame = CFrame.new(hole.CFrame.p, position) * CFrame.new(0, 0, -distance/2)
-- Remove Debris
game:GetService("Debris"):AddItem(trace, 0.1)
end
-- Hit Detection
if hit then
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
-- Double Damage Headshots
if hit.Name == "Head" then
humanoid:TakeDamage(dmg.Value*2)
else
-- Regular Damage bodyshots
humanoid:TakeDamage(dmg.Value)
end
end
end
wait(cooldown)
debounce = false
end)
end
end)
end)
Would greatly appreciate a response.

1 comment
Also what is the issue with mouse being a nil value? Ive tried to script another weapon I loaded in from blender (Ak-47) but it always ends up being an issue of the tool not being able to be equipped or a mouse nil error? Any way to get around this and any tips would be much appreciatied.