jan_kk

Sklep

Jan 27th, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.25 KB | None | 0 0
  1. on sign change:
  2.     if line 1 is "[Sklep]":
  3.         if player is not an op:
  4.             send "&4Nie masz uprawnien!"
  5.             cancel event
  6.             stop
  7.         set {_b} to line 3
  8.         set line 3 to "&4Kupno: %{_b}%"
  9.         set {_s} to line 4
  10.         set line 4 to "&eSprzedaz: %{_s}%"
  11.         set {tabliczki::%location of event-block%::b} to {_b}
  12.         set {tabliczki::%location of event-block%::s} to {_s}
  13.         send "&2Pomyslnie zmieniono!"
  14. on rightclick on sign:
  15.     if line 1 is "[Sklep]":
  16.         cancel event
  17.         if line 2 is set:
  18.             if line 3 is set:
  19.                 set {_} to line 2
  20.                 set {_b} to {tabliczki::%location of event-block%::b}
  21.                 if player's balance is greater or equal to {_b}:
  22.                     remove {_b} from player's balance
  23.                     give {_} to player
  24.                     send "&2Zakonczono tranzakcje!"
  25.                     stop
  26.                 else:
  27.                     send "&4Masz za malo pieniedzy!"
  28.                     stop
  29. on leftclick on sign:
  30.     if line 1 is "[Sklep]":
  31.         if player is an op:
  32.             if player  is holding diamond pickaxe:
  33.                 stop
  34.         cancel event
  35.         if line 2 is set:
  36.             if line 4 is set:
  37.                 set {_} to line 2
  38.                 set {_s} to {tabliczki::%location of event-block%::s}
  39.                 if player has {_}:
  40.                     remove {_} from player
  41.                     add {_s} to player's balance
  42.                     send "&2Zakonczono tranzakcje!"
  43.                     stop
  44.                 else:
  45.                     send "&4Nie masz tego przedmiotu!"
  46.                     stop
Advertisement
Add Comment
Please, Sign In to add comment