Guest User

Untitled

a guest
Jun 13th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.83 KB | None | 0 0
  1. --[[
  2. Name: "sh_vortigaunt.lua".
  3. Product: "HL2 RP".
  4. --]]
  5.  
  6. local FACTION = {};
  7.  
  8. FACTION.whitelist = true;
  9. FACTION.models = {
  10.     female = {"models/vortigaunt.mdl"},
  11.     male = {"models/vortigaunt.mdl"}
  12. };
  13.  
  14. -- Called when a player's model should be assigned for the faction.
  15. function FACTION:GetModel(player, character)
  16.     if (character.gender == GENDER_MALE) then
  17.         return self.models.male[1];
  18.     else
  19.         return self.models.female[1];
  20.     end;
  21. end;
  22.  
  23. -- Called when a player is transferred to the faction.
  24. function FACTION:OnTransferred(player, faction, name)
  25.     if (player:QueryCharacter("gender") == GENDER_MALE) then
  26.         player:SetCharacterData("model", self.models.male[1], true);
  27.     else
  28.         player:SetCharacterData("model", self.models.female[1], true);
  29.     end;
  30. end;
  31.  
  32. FACTION_VORTIGAUNT = nexus.faction.Register(FACTION, "Vortigaunts");
Add Comment
Please, Sign In to add comment