Advertisement
GDragonArcher

reply

Jun 30th, 2022 (edited)
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. local box = peripheral.find("chatBox") -- Finds the peripheral if one is connected
  2.  
  3. if box == nil then error("chatBox not found") end
  4.  
  5.  
  6. while true do
  7.   event, username, message = os.pullEvent("chat") -- Will be fired when someone sends a chat message
  8.   messageN = tonumber(message) + math.random(1,9)
  9.   messageS = tostring(messageN)
  10.  
  11.   box.sendMessage(messageS, username)-- Sends a message to the global chat
  12.   --box.sendMessage(messageS, username) -- Sends a message with the prefix "[breez]"
  13. end
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement