Jump to content




MiscPeripheral: Player Detector (how does it work)


  • This topic is locked This topic is locked
2 replies to this topic

#1 gheotic

  • Members
  • 64 posts
  • LocationDenmark

Posted 19 January 2013 - 09:33 AM

Can some one tell me how the Player detector block works?
how do i use the pull event command????


any help would be appreciated =)

#2 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 19 January 2013 - 10:11 AM

This should most probably be in Ask a pro or General...

And, take a look here, which explains how it works.

The block emits an event named 'player' when a player right clicks the block. The player name is then the first parameter of the os.pullEvent()

Example code:
while true do
    event, playerName = os.pullEvent("player")
    print("Hello " .. playerName)
end
That will print Hello and then the name of the player that clicked on the block

#3 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 19 January 2013 - 11:29 AM

Your post in the peripherals section was merged into the MiscPeripherals topic. That is the place you should have been asking, and the place you should be looking for answers. When you have a question about a specific peripheral, ask in that peripheral's topic. If that peripheral's topic is dead, or a couple weeks go by with no answer, then try posting in ask a pro.

Locked.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users