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!

Clockwork Lua Error from Plugin

Discussion in 'Discussion' started by Murfey, Mar 20, 2013.

  1. I am trying to get a plugin to work, but it produces an error I can't seem to work around, can someone here help me fix the issue? I would appreciate the help of others.

    The 'PlayerRestoreCharacterData' plugin hook has failed to run. cwcidertwo/schema/plugins/storage/sv_hooks lua 120: attempt to call me
    thod 'Get' (a nil value)

    -- Called when a player's character data should be restored.
    function PLUGIN:playerRestoreCharacterData(player, data)
    data["lockerstorage"] = data["lockerstorage"] or {};
    data["lockercash"] = data["lockercash"] or 0;

    for k, v in pairs( data["lockerstorage"] ) do
    local itemTable = Clockwork.item:Get(k); -- <= Line 120

    if (!itemTable) then
    hook.Call("PlayerHasUnknownInventoryItem", Clockwork, player, data["lockerstorage"], k, v);

    data["lockerstorage"][k] = nil;
    end;
    end;
    end;

    Please help!
     
  2. RJ

    RJ no pay Legend Clockwork Customer

    You should be using "Clockwork.item:GetAll()" instead of "Clockwork.item:Get()".
     
  3. What RJ said.

    Whenever you have a problem with something like this (for example, Clockwork.xxxx), go to

    clockwork\framework\libraries

    After that, open the file of xxxx. Then you can see all of the functions it uses.
     

Previous Readers (Total: 0)