This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
gheotic's profile picture

MiscPeripheral: Player Detector (how does it work)

Started by gheotic, 19 January 2013 - 08:33 AM
gheotic #1
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 =)
remiX #2
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
Lyqyd #3
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.