Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Called when a player's typing display has started.
- function Schema:PlayerStartTypingDisplay(player, code)
- if (player:GetFaction() == FACTION_MPF and !player:IsNoClipping()) then
- if (code == "n" or code == "y" or code == "w" or code == "r") then
- if (!player.typingBeep) then
- player.typingBeep = true;
- if local randomSounds = {1, 2};
- local randomNumber = math.random(1, 2); then
- player:EmitSound("npc/metropolice/r_on"..randomSounds[randomNumber]..".wav");
- end;
- end;
- end;
- elseif (player:GetFaction() == FACTION_OTA) then
- if (code == "n" or code == "y" or code == "w" or code == "r") then
- if (!player.typingBeep) then
- player.typingBeep = true;
- if local randomSounds = {1, 2};
- local randomNumber = math.random(1, 2); then
- player:EmitSound("npc/combine_soldier/r_on"..randomSounds[randomNumber]..".wav");
- end;
- end;
- end;
- end;
- end;
- -- Called when a player's typing display has finished.
- function Schema:PlayerFinishTypingDisplay(player, textTyped)
- if (player:GetFaction() == FACTION_MPF and textTyped) then
- if (player.typingBeep) then
- if local randomSounds = {1, 2, 3, 4};
- local randomNumber = math.random(1, 4); then
- player:EmitSound("npc/metropolice/r_off"..randomSounds[randomNumber]..".wav");
- end;
- end;
- elseif (player:GetFaction() == FACTION_OTA) then
- if (player.typingBeep) then
- if local randomSounds = {1, 2, 3};
- local randomNumber = math.random(1, 3); then
- player:EmitSound("npc/combine_soldier/r_off"..randomSounds[randomNumber]..".wav");
- end;
- end;
- end;
- end;
- player.typingBeep = nil;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement