Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. function ENT:Use( activator )
  2.     if( self:Getexperience() == 0 ) then return end
  3.     if( activator:IsValid() and activator:IsPlayer() ) then
  4.         activator:addXP( self:Getexperience() or 0 )
  5.         self:Setexperience( 0 )
  6.    
  7.         if self.Charges <= 0 then
  8.             activator:ChatPrint("You have finished reading "..self:Gettitle().."!")
  9.             self:Remove()
  10.         else
  11.             activator:ChatPrint("You have read a few chapters of "..self:Gettitle().."!")
  12.         end
  13.     end
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement