AppleJacksRP Please Help! :(

So this has been bugging me for a while now. I have set up Applejack correctly with a database and everything, and have edited and added quite a bit of content into it.

I do not think the problem is caused by any editing.

Anyway, in the init.lua file in the DoPlayerDeath hook, there is code that is meant to drop the player’s current weapons (not just active weapons), as cider entities that can be picked up straight into the inventory, whenever a player dies. It checks if the weapons are valid cider entities(IE, not a physgun or hands) and calls a hook to check if the weapons were given to the player at spawn. I have no idea where the fault lies but it sure doesn’t work.

[LUA]
– Called just before a ply dies.
function GM:DoPlayerDeath(ply, attacker, damageInfo)
ply._Deaded = true
if ply:InVehicle() then
ply:ExitVehicle()
end
if ValidEntity(ply._BackGun) then
ply._BackGun:Remove()
end
for k, v in pairs( ply:GetWeapons() ) do
local class = v:GetClass()

	-- Check if this is a valid item.
	if (self.Items[class]) then
		if ( hook.Call("PlayerCanDrop",GAMEMODE, ply, class, true, attacker) ) then
			self.Items[class]:Make(ply:GetPos(), 1);
		end
	end
end
if #ply._StoredWeapons >= 1 then
	for _, v in pairs(ply._StoredWeapons) do
		local class = v
		
		-- Check if this is a valid item.
		if (self.Items[class]) then
			if ( hook.Call("PlayerCanDrop",GAMEMODE, ply, class, true, attacker) ) then
				self.Items[class]:Make(ply:GetPos(), 1);
			end
		end
	end
	ply._StoredWeapons = {}
end

-- Unwarrant them, unarrest them and stop them from bleeding.
if (ply ~= attacker and attacker:IsPlayer()) then
	ply:UnWarrant();
end
ply:UnArrest(true);
ply:UnTie(true);
ply:StopBleeding()

-- Strip the ply's weapons and ammo.
ply:StripWeapons()
ply:StripAmmo()

-- Add a death to the ply's death count.
ply:AddDeaths(1)

-- Check it the attacker is a valid entity and is a ply.
if ( ValidEntity(attacker) and attacker:IsPlayer() ) then
	if (ply ~= attacker) then
		if ( hook.Call("PlayerCanGainFrag",GAMEMODE, attacker, ply) ) then
			attacker:AddFrags(1)
		end
	end
end

end
[/LUA]

Thanks For Looking/Answering :slight_smile: