Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.43 KB | None | 0 0
  1.  
  2. -- Called when a player's typing display has started.
  3. function Schema:PlayerStartTypingDisplay(player, code)
  4.     if (player:GetFaction() == FACTION_MPF and !player:IsNoClipping()) then
  5.         if (code == "n" or code == "y" or code == "w" or code == "r") then
  6.             if (!player.typingBeep) then
  7.                 player.typingBeep = true;
  8.                 if local randomSounds = {1, 2}; then
  9.                     player:EmitSound("npc/metropolice/r_on"..randomSounds[randomNumber]..".wav");
  10.                 end;
  11.             end;
  12.         end;
  13.     elseif (player:GetFaction() == FACTION_OTA) then
  14.         if (code == "n" or code == "y" or code == "w" or code == "r") then
  15.             if (!player.typingBeep) then
  16.                 player.typingBeep = true;
  17.                 if local randomSounds = {1, 2}; then
  18.                     player:EmitSound("npc/combine_soldier/r_on"..randomSounds[randomNumber]..".wav");
  19.                 end;
  20.             end;
  21.         end;
  22.     end;
  23. end;
  24.  
  25. -- Called when a player's typing display has finished.
  26. function Schema:PlayerFinishTypingDisplay(player, textTyped)
  27.     if (player:GetFaction() == FACTION_MPF and textTyped) then
  28.         if (player.typingBeep) then
  29.             if local randomSounds = {1, 2, 3}; then
  30.                 player:EmitSound("npc/metropolice/r_off"..randomSounds[randomNumber]..".wav");
  31.             end;
  32.         end;
  33.     elseif (player:GetFaction() == FACTION_OTA) then
  34.         if (player.typingBeep) then
  35.             if local randomSounds = {1, 2, 3}; then
  36.                     player:EmitSound("npc/combine_soldier/r_on"..randomSounds[randomNumber]..".wav");
  37.                 end;
  38.             end;
  39.         end;
  40.     end;
  41.    
  42.     player.typingBeep = nil;
  43. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement