Error Console:
Code:
Paul Johnson has gained a Broken Pistol 1516548281.
You have given Paul Johnson a Broken Pistol.
Paul Johnson has used '/CharGiveItem johnson broken'.
[HTML] http://forums.cloudsixteen.com/js/xenforo/xenforo.js?_v=073095e7:170: Uncaught TypeError: Property 'group' of object #<error> is not a function
You failed to repair the pistol!
Paul Johnson has lost a Broken Pistol 1516548281.
Paul Johnson has used '/InvAction use broken_pistol 1516548281.00'.
Current state of the code:
Code:
-- Created by NoahtheBoah36 AKA Noah Engelmann
-- Redistribution/use/modification is allowed provided credit is given.
local ITEM = Clockwork.item:New();
ITEM.name = "Broken Pistol";
ITEM.model = "models/weapons/w_pistol.mdl";
ITEM.weight = 0.5;
ITEM.business = true;
ITEM.batch = 1;
ITEM.access = "@";
ITEM.description = "[RED CONTRABAND] A broken handgun. Now who left this lying around?";
ITEM.category = "Crafting";
ITEM.useText = "Repair";
-- When the item is dropped.
function ITEM:OnDrop(player, position) end;
-- When the item is used.
function ITEM:OnUse(player, itemEntity)
--local ability = Clockwork.attributes:Fraction(player, ATB_SCAVENGING, 1);
local ability = Clockwork.attributes:Fraction(player, ATB_SCAVENGING, 1, 1);
print("Ability:");
print(ability);
local difficulty = math.random(1, 25);
print("Difficulty:");
print(difficulty);
if (ability >= difficulty) then
Clockwork.player:Notify(player, "You successfully repaired the pistol!");
player:GiveItem(Clockwork.item:CreateInstance("weapon_pistol"), true);
Clockwork.attributes:Progress(player, ATB_SCAVENGING, difficulty);
return;
else
Clockwork.player:Notify(player, "You failed to repair the pistol!");
Clockwork.attributes:Progress(player, ATB_SCAVENGING, difficulty + ability);
return;
end;
end;
ITEM:Register();
Still not working.