Lorc520

player connection reaction

Jun 11th, 2025
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. local chatBox = peripheral.find("chatBox")
  2.  
  3. while true do
  4. local event, username, message = os.pullEvent("chat")
  5.  
  6. if message:find("joined the game") then
  7. print("Player joined: " .. username)
  8. chatBox.sendMessage("hello " .. username)
  9. -- Optionally: trigger redstone here too
  10. end
  11. end
  12.  
Advertisement
Add Comment
Please, Sign In to add comment