Add Custom Items
#5
It of course depends on what you want an item to do:
function OnPlayerRightClick(a_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ)
	if (a_Player:GetEquippedItem().m_ItemType ~= <some custom item id>) then
		return false;
	end
	
	-- Add some custom handling like firing a projectile or something.
end
Don't forget to register the hook using cPluginManager:AddHook
Reply
Thanks given by:


Messages In This Thread
Add Custom Items - by Boo - 03-15-2017, 12:27 AM
RE: Add Custom Items - by xoft - 03-15-2017, 12:35 AM
RE: Add Custom Items - by NiLSPACE - 03-15-2017, 12:36 AM
RE: Add Custom Items - by Boo - 03-22-2017, 05:27 PM
RE: Add Custom Items - by NiLSPACE - 03-22-2017, 05:43 PM
RE: Add Custom Items - by Boo - 03-22-2017, 06:08 PM
RE: Add Custom Items - by xoft - 03-22-2017, 06:34 PM
RE: Add Custom Items - by Boo - 03-22-2017, 07:27 PM
RE: Add Custom Items - by NiLSPACE - 03-22-2017, 08:54 PM
RE: Add Custom Items - by Boo - 03-22-2017, 09:07 PM
RE: Add Custom Items - by NiLSPACE - 03-23-2017, 12:15 AM
RE: Add Custom Items - by Boo - 03-23-2017, 12:56 AM
RE: Add Custom Items - by NiLSPACE - 03-23-2017, 01:15 AM
RE: Add Custom Items - by Boo - 03-23-2017, 05:36 PM
RE: Add Custom Items - by Mathias - 03-23-2017, 12:32 AM



Users browsing this thread: 1 Guest(s)