Advertisement
ACheats

PISS

Dec 13th, 2023 (edited)
688
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.55 KB | None | 0 0
  1. local caller = getScriptCaller()
  2. local t = getAllUserData()
  3. local rate_prefix = "piss"
  4. local time_delay = 1*60*60
  5.  
  6. function contains(table, val)
  7.    for i=1,#table do
  8.       if table[i] == val then
  9.          return true
  10.       end
  11.    end
  12.    return false
  13. end
  14.  
  15. function getDelta()
  16.   local t = {}
  17.   t.current = getLocalData(rate_prefix .. tostring(caller.id))
  18.   t.delta = math.random(0, 10)
  19.   t.delta = signRoll(t.delta)
  20.   if t.current + t.delta < 0 then
  21.     t.delta = -t.current
  22.     t.current = 0
  23.   else
  24.     t.current = t.current + t.delta
  25.   end
  26.   setLocalData(rate_prefix .. tostring(caller.id), t.current)
  27.   return t
  28. end
  29.  
  30. function updateTime(timeType)
  31.   setLocalData(rate_prefix .. tostring(caller.id) .. timeType, os.time())
  32. end
  33.  
  34.  
  35. function checkTime(timeType)
  36.   local time = getLocalData(rate_prefix .. tostring(caller.id) .. timeType)
  37.   if not time then
  38.     setLocalData(rate_prefix .. tostring(caller.id), 0)
  39.     updateTime(timeType)
  40.     return true
  41.   end
  42.   if time and os.time() - tonumber(time) > time_delay then
  43.     updateTime(timeType)
  44.     return true
  45.   end
  46.   return false
  47. end
  48.  
  49. function printTop()
  50.   local t = getAllUserData()
  51.   local s = 'ТОП ОБОССЫВАТЕЛЕЙ КОНФЫ\n'
  52.   --local r = {}
  53.   if not getUserCount() then
  54.     return 'Используй в конфе!'
  55.   end
  56.   for i = 1, getUserCount() do
  57.     if t[i] and t[i].id and getLocalData(rate_prefix .. tostring(t[i].id)) then
  58.       t[i].score = tonumber(getLocalData(rate_prefix .. tostring(t[i].id)))
  59.     else
  60.       t[i] = nil
  61.     end
  62.   end
  63.   local c = {}
  64.   for i = 1, getUserCount() do
  65.     if t[i] then
  66.       table.insert(c, t[i])
  67.     end
  68.   end
  69.   table.sort(c, function(a,b) return a.score > b.score end)
  70.   for i = 1, #c do
  71.     if c[i].first_name then
  72.       s = s .. c[i].first_name .. ' - ' ..c[i].score .. '\n'
  73.     end
  74.   end
  75.   return s
  76. end
  77.  
  78. function piss(params)
  79. if params == caller.username then return "*Ты обоссался, но это не защитывается!" end
  80. if checkTime('piss') then
  81.       for i = 1, getUserCount() do
  82.         if t[i] and t[i].id and t[i].username == params then
  83.           local rep = 1
  84.           local current = getLocalData(rate_prefix ..  tostring(caller.id)) or 0
  85.           setLocalData(rate_prefix ..  tostring(caller.id), current+rep)
  86.           return "🍾" .. caller.username .. "🍾 " .. "обоссал ".. params .. "🍹🫦"
  87.         end
  88.       end
  89.       return "*Не нахожу чувака с ником " .. params
  90.        else
  91.         return os.date('Ты уже поссал недавно.\n Приходи через %H часов %M минут', time_delay - os.time() + tonumber(getLocalData(rate_prefix ..  tostring(caller.id .. 'piss'))))
  92.     end
  93. end
  94.  
  95. function serve(params)
  96.   return piss(params)
  97. end
  98.  
  99. if _ARGS == 'top' or _ARGS == 'топ' then
  100.   return printTop()
  101. end
  102.  
  103. if _ARGS == 'reset' or _ARGS == 'сброс' then
  104.   if getScriptCaller().username == "Ox7FF"
  105.     then
  106.       setLocalData(rate_prefix ..  tostring(caller.id) .. "piss", 0)
  107.     return "*Временные настройки сброшены."
  108.   else return "*Ты не админ."
  109.   end
  110. end
  111.  
  112.  
  113.  
  114. if _ARGS then
  115.   local index = string.find(_ARGS, '@')
  116.  
  117.   if index then
  118.     params = string.gsub(_ARGS, "@", "")
  119.     return serve(params)
  120.   else
  121.     action = _ARGS
  122.     return serve(action)
  123.   end
  124. end
  125.  
  126. return [[
  127. ==========СИСТЕМА РЕЙТИНГА==========
  128. !!piss @username - обоссать пользователя.
  129. !!piss top - вывести топ пользователей.
  130. ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement