Inventory:remove - brianhang/nutscript2 GitHub Wiki

Description

... = Inventory:remove(...)

This server function takes away an item into the given inventory.

Parameters

Name Description
... The parameter(s) depend on the implementation.

Side Effects

  • The inventory is modified.

Returns

Name Description
... The return value(s) depend on the implementation.

Example

-- Creates a command that removes an apple from players.
concommand.Add("takeapple", function(client, command, arguments)
    -- Get the player's loaded character.
    local character = client:getChar()

    -- Make sure the character exists.
    if (character) then
        character:getInv():remove("apple")
    end
end)