Advertisement
osten04

Player detector ( simple )

Mar 22nd, 2025
517
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.34 KB | None | 0 0
  1. local radius = 120.0
  2.  
  3. local detector      = peripheral.find( "playerDetector" )
  4. local integrator    = peripheral.find( "redstoneIntegrator" )
  5.  
  6. while( true ) do
  7.     os.sleep( 2.0 )
  8.        
  9.     local players = detector.getPlayersInRange( radius )
  10.     local inRange = ( ( #players ) ~= 0 )
  11.  
  12.     integrator.setOutput( "right", inRange )
  13. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement