Guest User

startup.lua

a guest
Sep 19th, 2019
103
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mod = peripheral.wrap('back')
  2. mod.open(15)
  3. delay = 0.001
  4. x = 2
  5. cool = 0
  6.  
  7. z2 = {'-', ''}
  8. while true do
  9.     a, b, c, d, payload = os.pullEvent('modem_message')
  10.    
  11.     if payload == 'Arrow' then
  12.         cool = cool + 0.2
  13.         x = math.random(2,3)
  14.         x2 = math.random(0,9)
  15.         z = math.random(0,3)
  16.        -- y = math.random(0,2)
  17.         s = math.random(1,2)
  18.         sleep(delay)
  19.         commands.summon('Arrow ~2 ~1 ~ {damage:10,Motion:['..x..'.'..x2..',0.0,'..z2[s]..'0.'..z..']}')
  20.        
  21.         if cool > 15 then
  22.             sleep(3)
  23.             cool = 0
  24.             commands.kill('@e[type=Arrow]')
  25.         end
  26.    
  27.     else
  28.         cool = 0    
  29.         --commands.kill('@e[type=Arrow]')    
  30.    
  31.     end
  32.    
  33.     sleep(0.01)
  34.  
  35. end
RAW Paste Data