Jump to content

Terminal Glasses - grabbing playername and displaying on HUD

lua peripheral

4 replies to this topic

#1 xNightmare

  • New Members
  • 2 posts

Posted 17 June 2015 - 05:22 PM

Hello there,

I've been trying to work on my own little custom HUD for the past day or so, and I was wondering how I could personify it to the extent where the program would be able to detect the name of the player who was wearing the glasses, then being able to display it on the HUD. I have no idea on how this would be achieved, hence why I came here.

I'd appreciate any help here.

#2 The Crazy Phoenix

  • Members
  • 136 posts
  • LocationProbably within 2 metres of my laptop.

Posted 17 June 2015 - 06:52 PM

There is indeed a method that allows you to get a list of all connected players (however, I cannot remember). It returns an array of all players with the terminal glasses equipped. The command event also includes a player argument, which allows you to know which player issued a certain command. It is however impossible to make a player-specific HUD using only one Terminal Glasses Bridge, you would need multiple to do so.

#3 xNightmare

  • New Members
  • 2 posts

Posted 18 June 2015 - 12:50 AM

Pretty sure it's possible. The "Plastic" program seems to cue the player by name.

#4 doublequestionmark

  • Members
  • 118 posts
  • LocationI honestly don't know

Posted 18 June 2015 - 01:54 AM

View PostxNightmare, on 18 June 2015 - 12:50 AM, said:

Pretty sure it's possible. The "Plastic" program seems to cue the player by name.
if i recall correctly, the plastic program asks you to enter your name during setup

#5 RootSlayers

  • Members
  • 13 posts
  • LocationIn front of my Computer @LocalHost - France

Posted 23 July 2015 - 10:47 PM

Hello there !

To detect the name of the player(s) who wearing the Terminal Glasses you need to call this fonction :

Users = Glasses.getUsers()

Users is the array containing the player name.
Glasses is the T. Glasses object.

I hope this helps :)

Edited by RootSlayers, 23 July 2015 - 10:47 PM.

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users