I am currently trying to fix a problem that my Darkrp server is having. Whenever someone drops a crowbar, it drops the view model instead of the world model and it cannot be removed in any way. I cannot seem to fix the problem in any other way so I figured the best course of action would be to restrict being able to drop the crowbar completely. I found the bit of code that says which weapons cannot be dropped and the way it works is that if the weapon can be bought via shipments then you can drop it. I would like to add an additional if statement to check if the weapon attempting to be dropped is a crowbar but I’m not very good at LUA syntax. Here’s the code:
if GetConVarNumber("RestrictDrop") == 1 then local found = false for k,v in pairs(CustomShipments) do if v.entity == ent:GetClass() then found = true break end end if not found then Notify(ply, 1, 4, LANGUAGE.cannot_drop_weapon) return "" end end
I was planning on adding “if v.entity == “weapon_crowbar” then break” or something like that after the loop starts, but I don’t know the proper syntax. Could someone please help me?