Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. -- Called when a player attempts to unlock an entity.
  2. function PLUGIN:PlayerCanUnlockEntity(player, entity)
  3.     if (Clockwork.entity:IsDoor(entity)) then
  4.         local shop = player:GetCharacterData("shop")
  5.         local shopNumber = string.sub(Clockwork.entity:GetDoorName(entity), 8)
  6.        
  7.         if (shopNumber == shop) then
  8.             return true;
  9.         end;
  10.     end;
  11. end;
  12.  
  13. -- Called when a player attempts to lock an entity.
  14. function PLUGIN:PlayerCanLockEntity(player, entity)
  15.     if (Clockwork.entity:IsDoor(entity)) then
  16.         local shop = player:GetCharacterData("shop")
  17.         local shopNumber = string.sub(Clockwork.entity:GetDoorName(entity), 8)
  18.        
  19.         if (shopNumber == shop) then
  20.             return true;
  21.         end;
  22.     end;
  23. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement