1. This forum is ARCHIVED! Visit the new Cloud Sixteen forums, codename Eden, at https://eden.cloudsixteen.com. These forums will remain archived for a few months before being closed down, so try to encourage plugin developers to begin moving their content across to the new forums.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

Other Primary Needs v2 item problem

Discussion in 'Development' started by MiliViu, Aug 16, 2018.

  1. MiliViu

    MiliViu Clockwork Customer

    I have the plugin Primary Needs V2, and when i try to create an item, this one doesent have the eat option



    This is one of this

    Void the spanish :)

    local ITEM = Clockwork.item:New();
    ITEM.name = "Pan";
    ITEM.cost = 0;
    ITEM.model = "models/bioshockinfinite/dread_loaf.mdl";
    ITEM.weight = 0.3;
    ITEM.access = "v";
    ITEM.useText = "eat";
    ITEM.category = "Consumables";
    ITEM.business = true;
    ITEM.description = "Una barra de pan recien hecha con un olor agradable, tiene la marca UU pegada en el.";
    ITEM.hunger = 35;

    -- Called when a player drops the item.
    function ITEM:OnDrop(player, position) end;

    ITEM:Register();
     
  2. Aspect

    Aspect =) Legend Clockwork Customer

    You didn't give it a use function.
     
  3. MiliViu

    MiliViu Clockwork Customer

    i think im dumb xd
     
  4. MiliViu

    MiliViu Clockwork Customer

    The use function need to have something special?
     
  5. BurningMadness

    BurningMadness Clockwork Customer

    Ye, Primary needs is really confusing, it work then the next day it stopped working, i also had an issue with one item not having any error but still not working, i had to rescript it 1:1 and it worked, magic.

    So, try instead of having
    ITEM.hunger = 35;

    Delete it and add in your function for "on use"
    player:SetCharacterData("hunger", math.Clamp(player:GetCharacterData("hunger", 0) - ?, 0, 100));
    and this should work
     
  6. MiliViu

    MiliViu Clockwork Customer

    thanks ^^ im going to doit now
     

Previous Readers (Total: 0)