Thread: Difference between revisions

From PZwiki
m (Checked and updated to version 40.43)
(Add code for ripping clothing)
Line 27: Line 27:


== Code ==
== Code ==
=== Item ===
'''''From items.txt (Project Zomboid directory/media/scripts/)'''''
'''''From items.txt (Project Zomboid directory/media/scripts/)'''''
{{Retrieved|version=40|incver=43}}
{{Retrieved|version=40|incver=43}}
Line 37: Line 38:
Icon = Thread,
Icon = Thread,
cantBeConsolided = TRUE,</pre>
cantBeConsolided = TRUE,</pre>
=== Obtaining from ripping clothing ===
'''''From recipecode.txt (Project Zomboid directory/media/lua/server/)'''''
{{Retrieved|version=41|incver=50}}
<pre>
    -- add thread sometimes, depending on tailoring level
    if ZombRand(7) < player:getPerkLevel(Perks.Tailoring) + 1 then
        local max = 2;
        if nbrOfCoveredParts then
            max = nbrOfCoveredParts;
            if max > 6 then
                max = 6;
            end
        end
        max = ZombRand(2, max);
        local thread = InventoryItemFactory.CreateItem("Base.Thread");
        for i=1,10-max do
            thread:Use();
        end
        player:getInventory():AddItem(thread);
    end
</pre>


== See also ==
== See also ==

Revision as of 02:33, 4 June 2021

Thread
Thread
General
Category Item
Encumbrance
Heavy Load
0.1
Function Craft mattress
Stitch deep wounds
Technical details
Base ID Base.Thread

Thread is an item used in carpentry and first aid.

Usage

Thread is required in crafting a mattress.

Medical

Thread can be used with a needle to stitch deep wounds, however causing more pain than using a suture needle.

Crafting

Template:Crafting table header |- |
| | | ||
||
||
||
||
||
||
||
||
||
||
Template:Crafting table footer

Distribution

Thread can be found in sheds, stores and some vehicles.

Code

Item

From items.txt (Project Zomboid directory/media/scripts/) Retrieved: Build 40.43

	item Thread
		Weight			= 0.1,
		Type			= Drainable,
        	UseWhileEquipped	= FALSE,
        	UseDelta		= 0.1,
		DisplayName		= Thread,
		Icon			= Thread,
		cantBeConsolided	= TRUE,


Obtaining from ripping clothing

From recipecode.txt (Project Zomboid directory/media/lua/server/) Retrieved: Build 41.50

    -- add thread sometimes, depending on tailoring level
    if ZombRand(7) < player:getPerkLevel(Perks.Tailoring) + 1 then
        local max = 2;
        if nbrOfCoveredParts then
            max = nbrOfCoveredParts;
            if max > 6 then
                max = 6;
            end
        end
        max = ZombRand(2, max);
        local thread = InventoryItemFactory.CreateItem("Base.Thread");
        for i=1,10-max do
            thread:Use();
        end
        player:getInventory():AddItem(thread);
    end

See also

General First Aid

Template:Navbox/Consumables