Ty, think I've got it working now.
Code:
local ITEM = Clockwork.item:New();
ITEM.name = "CPF Starter Kit";
ITEM.model = "models/props_c17/consolebox05a.mdl";
ITEM.weight = 4;
ITEM.access = false;
ITEM.useText = "Open";
ITEM.category = "Storage"
ITEM.business = true;
ITEM.description = "A biolocked and heavy container, with a union logo stamped on the front in black.";
-- Called when a player uses the item.
function ITEM:OnUse(player, itemEntity)
if (player:GetFaction() == FACTION_CITIZEN) then
Clockwork.player:Notify(player, "*Beep* Unauthorized Access Detected");
ITEM.useSound = "HL1/fvox/flatline.wav";
Clockwork.player:Notify(player, "*Beep* Alerting CPF within close vicinity");
ITEM.useSound = "HL1/fvox/fuzz.wav" * 10;
elseif (player:GetFaction() == FACTION_CWU) then
Clockwork.player:Notify(player, "*Beep* Unauthorized Access Detected");
ITEM.useSound = "HL1/fvox/flatline.wav";
Clockwork.player:Notify(player, "*Beep* Alerting CPF within close vicinity");
ITEM.useSound = "HL1/fvox/fuzz.wav" * 10;
return false;
else
Clockwork.player:GiveCash(player, 500, "CPF starter kit");
player:GiveItem(Clockwork.item:CreateInstance("civil_protection_uniform"));
player:GiveItem(Clockwork.item:CreateInstance("union_grade_filter"));
player:GiveItem(Clockwork.item:CreateInstance("")
end;
end;
-- Called when a player drops the item.
function ITEM:OnDrop(player, position) end;
ITEM:Register();
Btw, I was assuming that doing
ITEM.useSound = "HL1/fvox/fuzz.wav" * 10;
would repeat the same line 10 times right?
Or does it not in LUA?