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 Citizens voice not working

Discussion in 'Development' started by CHOPPER, Jun 5, 2019.

  1. Hi, I'm trying to make a citizen voice command plugin but since I'm new to Lua I can't do it. Here is the code:
    https://puu.sh/DEz4y.lua
    Any help is appreciated!
     
    Last edited: Jun 11, 2019
  2. redcatjack

    redcatjack Moderator and Map Developer Staff Member Moderator

    Moved to Development
     
  3. Savvyge Investments

    Savvyge Investments Clockwork Customer

    One stupid Idea I had was to make an item with the voice command tied to the UseSound that not only plays the voice command you want on use, but it replaces itself in your inventory, using the ration method.
     
  4. Kinda interesting idea.
     
  5. Savvyge Investments

    Savvyge Investments Clockwork Customer



    Code:
    local ITEM = Clockwork.item:New();
    ITEM.name = "Hi Male";
    ITEM.cost = 1;
    ITEM.model = "models/props_c17/TrapPropeller_Lever.mdl";
    ITEM.weight = 0;
    ITEM.useText = "Hi-VoiceCommand";
    ITEM.useSound = "vo/npc/male01/hi01.wav";
    ITEM.category = "Voice Commands";
    ITEM.business = false;
    ITEM.access = "V";
    ITEM.batch = 1;
    ITEM.description = "A re-useable voice command. Handed out to trusted roleplayers.";
    -- Called when a player uses the item.
    function ITEM:OnUse(player, itemEntity)
        if (Schema:PlayerIsCombine(player)) then
            Clockwork.player:Notify(player, "You cannot open this ration!");
           
            return false;
        elseif (player:GetFaction() == FACTION_ADMIN) then
            Clockwork.player:Notify(player, "You cannot open this ration!");
           
            return false;
        else
            Clockwork.player:GiveCash(player, 0, "ration packet");
           
            player:GiveItem(Clockwork.item:CreateInstance("Hi Male"), true);
           
            Clockwork.plugin:Call("PlayerUseRation", player);
        end;
    end;
    
    -- Called when a player drops the item.
    function ITEM:OnDrop(player, position) end;
    
    ITEM:Register();
     
  6. Aspect

    Aspect =) Legend Clockwork Customer

    What
     
  7. Savvyge Investments

    Savvyge Investments Clockwork Customer

    See the above post I made. It has a spoiler attached.
     
  8. Aspect

    Aspect =) Legend Clockwork Customer

    That..
    That's not...

    Oh lord.
    Where is-
    I can't, my head, @Oliver help
     
  9. I agree It's kinda bad idea but not everyone is a Lua maniac or Lua master whatever you call it.
     
  10. Savvyge Investments

    Savvyge Investments Clockwork Customer

    I don't see anyone handing out free HOLD C for Voice Command menus so.
     
  11. I know, no one also handles a free chat voice command.
     
    • Agree Agree x 1
  12. dead flag blues

    dead flag blues "...ours is a world of nuclear giants..." Clockwork Customer

    Code monkey.
     

Previous Readers (Total: 0)