So, I'm getting an error.
Error:
Code:
[ERROR] gamemodes/cwhl2rp/schema/items/sh_combat_armor.lua:16: attempt to index global 'character' (a nil value)
1. GetReplacement - gamemodes/cwhl2rp/schema/items/sh_combat_armor.lua:16
2. GetClientSideModel - gamemodes/clockwork/framework/items/sh_clothes_base.lua:61
3. GetIconInfo - gamemodes/clockwork/framework/libraries/sh_item.lua:749
4. Init - gamemodes/clockwork/framework/derma/cl_inventory.lua:364
5. Create - lua/includes/extensions/client/panel/scriptedpanels.lua:37
6. Rebuild - gamemodes/clockwork/framework/derma/cl_inventory.lua:233
7. OnSelected - gamemodes/clockwork/framework/derma/cl_inventory.lua:254
8. unknown - gamemodes/clockwork/framework/derma/cl_menu.lua:242
Timer Failed! [Simple][@gamemodes/clockwork/framework/derma/cl_menu.lua (line 239)]
Also, the following appears in my (clientside) console whenever I open the inventory tab.
Code:
[Clockwork:Kernel]
The 'MenuOpened' clockwork hook has failed to run.
gamemodes/cwhl2rp/schema/items/sh_combat_armor.lua:16: attempt to index global 'character' (a nil value)
This is the item script I'm having trouble with itself.
Code:
-- Created by Noah Engelmann AKA NoahtheBoah36.
-- Permission to Redistribute/Reuse/Edit is granted, provided credit is given.
local ITEM = Clockwork.item:New("clothes_base");
ITEM.name = "Combat Armor";
ITEM.group = "fallout_3";
ITEM.cost = 5000;
ITEM.weight = 5;
ITEM.access = "A";
ITEM.business = true;
ITEM.protection = 0.0;
ITEM.description = "A suit of combat armor, colored white as suprlus Anchorage equipment.";
-- Setting the player model.
function ITEM:GetReplacement(player)
if (character.gender == GENDER_MALE) then
return "models/nikout/fallout/wintercombatarmormale.mdl";
elseif (character.gender == GENDER_FEMALE) then
return "models/nikout/fallout/wintercombatarmorfemale.mdl";
end;
end;
ITEM:Register();
And a quick screenshot of what my inventory tab looks like.
http://steamcommunity.com/sharedfiles/filedetails/?id=1224392981
It appears like the error is with the model itself, but I'm 115% sure that the model is part of a content pack on the server.
Also, I'll level: I have a suspicion that the error has to do with the character.gender part of the if statement, but I'm not sure why that's a problem, and how to fix it.