If I understand your description right. You're getting this error clientside.
ents.Create()
is a serverside function. To create a clientside entity, you'll need ents.CreateClientProp()
.
Read up on my GMod (It's been a while, since I programmed GMod Lua..) Try this:
function SWEP:PrimaryAttack()
if SERVER then
local money = ents.Create("spawned_money")
money:SetPos(self:GetPos())
money.dt.amount = 500
money:Spawn()
money:Activate()
end
end