Advertisement
KananGamer

Livro com Páginas

May 10th, 2017
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.24 KB | None | 0 0
  1. pagina1 = " Página 1"
  2. pagina2 = " Página 2"
  3. pagina3 = " Página 3"
  4. maxpag = 3 -- Limite de páginas
  5. pags={pagina1,pagina2,pagina3}
  6. -- Script --
  7. pagcont = 1
  8. function openBook(playerName)
  9.  
  10.     ui.addTextArea(1,"",playerName,290,100,250,250,0x603A1B,0x603A1B,1,true)
  11.     ui.addTextArea(2,"",playerName,286,96,250,250,0xffffff,0xffffff,1,true)
  12.     ui.addTextArea(3,"",playerName,282,92,250,250,0x77197A,0x603A1B,1,true)
  13.     ui.addTextArea(4,"",playerName,480,190,50,50,0x603A1B,0x503117,1,true)
  14.     ui.addTextArea(5,"<a href='event:abrir'>  ",playerName,497,198,15,15,0x010101,0x010101,1,true)
  15.     ui.addTextArea(6,"",playerName,503,216,3,14,0x010101,0x010101,1,true)
  16.     ui.addTextArea(7,"<p align='center'><font size='35' face='Soopafresh'>Livro 1\n<p align='center'><font size='20' face='Verdana'>Aprendiz",playerName,340,140,0,0,0,0,1,true)
  17.    
  18. end
  19.  
  20. openBook(playerName)
  21.  
  22. function openedBook(playerName)
  23.  
  24.     ui.addTextArea(8,'',playerName,290,100,250,250,0x603A1B,0x603A1B,1,true)
  25.     ui.addTextArea(9,'',playerName,286,96,250,250,0xffffff,0xffffff,1,true)
  26.     ui.addTextArea(10,"<font color='#010101' size='13'>"..pags[pagcont],playerName,296,96,240,220,0xffffff,0xffffff,0,true)
  27.     ui.addTextArea(11,"<a href='event:fechar'>    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n",playerName,280,95,10,255,0x603A1B,0x603A1B,1,true)
  28.     ui.addTextArea(12,"<font size='18' color='#010101'><p align='center'>"..pagcont.."/"..maxpag,playerName,300,318,240,0,1,1,0,true)
  29.     ui.addTextArea(13,"<font size='30'><a href='event:passpage'>→",playerName,500,310,0,0,1,1,0,true)
  30.     ui.addTextArea(14,"<font size='30'><a href='event:unpasspage'>←",playerName,300,310,0,0,1,1,0,true)
  31.    
  32. end
  33. function eventTextAreaCallback(id,playerName,link)
  34.  
  35.     if link == "abrir" then
  36.         openedBook(playerName)
  37.     for i = 1,7 do
  38.         ui.removeTextArea(i,playerName)
  39.     end
  40.    
  41.     end
  42.     if link == "passpage" then
  43.         if pagcont <= maxpag-1 then
  44.             pagcont = pagcont + 1
  45.             openedBook(playerName)
  46.         end
  47.     end
  48.    
  49.     if link == "unpasspage" then
  50.         if pagcont ~= 1 then
  51.             pagcont = pagcont - 1
  52.             openedBook(playerName)
  53.         end
  54.     end
  55.    
  56.     if link == "fechar" then
  57.         openBook(playerName)
  58.         for i = 8,14 do
  59.             ui.removeTextArea(i,playerName)
  60.         end
  61.     end
  62.    
  63. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement