I've solved this know, this answer is no longer in use.
LOCAL SCRIPT:
local tool = script.Parent
local config = tool:WaitForChild("Config")
local remotes = tool:WaitForChild("Remotes")
local actionservice = game:GetService("ContextActionService")
local equipped = false
local reloading = false
local lastShot = tick()
--Animations
--Sounds
--Remotes
local canreload = remotes:WaitForChild("CanReload")
local canshoot = remotes:WaitForChild("CanShoot")
local fire = remotes:WaitForChild("Fire")
local hit = remotes:WaitForChild("Hit")
local reload = remotes:WaitForChild("Reload")
--Config
local range = config:WaitForChild("Range")
local reloadtime = config:WaitForChild("ReloadTime")
local ammo = config:WaitForChild("Ammo")
local spareammo = config:WaitForChild("SpareAmmo")
local Damage = config:WaitForChild("Damage")
local headshot = config:WaitForChild("Headshot")
local magsize = config:WaitForChild("MagSize")
local firerate = config:WaitForChild("FireRate")
tool.Equipped:Connect(function()
equipped = true
end)
tool.Unequipped:Connect(function()
equipped = false
reloading = false
end)
local function canshootf()
print("Invoked!")
if math.abs(lastShot - tick()) > (60/firerate.Value) then
print("Gun fire has not went past the fire rate value")
if equipped then
print("Equipped is true")
if not reloading then
print("Reloading is false")
if ammo.Value > 0 then
print("Ammo is greater than 1")
return true
else
tool.Sounds.EmptySound:Play()
end
end
end
else
print("Gun cannot shot")
return false
end
end
canshoot.OnServerInvoke = canshootf
oh well my local script part is gone for some reason

2 comments
Also this is part of a bigger script, but that's not having problems.
You're treating RemoteFunctions like a RemoteEvent, which they are not - https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events