Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- START API - smHUD
- sh=peripheral.find("antenna")
- function getHUD(player)
- hm = sh.getHUD(player)
- return hm
- end
- function getGUI(player)
- hm = sh.getHUD(player)
- return hm.getGUI()
- end
- -- END API - smHUD
- -- Grab Huds From These Employies
- local huders = {
- "NAME1",
- "NAME2",
- }
- function getEmHUDS(hudppl)
- local emhuds = {}
- for i = 1, #hudppl do
- emhuds[#emhuds+1] = smHUD.getHUD(hudppl[i])
- end
- return emhuds
- end
- -- clear huds
- function clearHUDS(huds)
- for i = 1, #huds do
- huds[i].clear()
- huds[i].sync()
- end
- end
- -- Hud Broadcasting
- function broadcastHUD(huds,message,x,y)
- for i = 1, #huds do
- huds[i].drawString(tostring(message),x,y,125,true)
- huds[i].add()
- end
- end
- -- Get Utils
- local pd = peripheral.wrap("right")
- os.loadAPI("smHUD")
- local pRange = 100
- local userhuds = {}
- userhuds = getEmHUDS(huders)
- plrz = {}
- function getPlayers()
- return pd.getNearbyPlayers(tonumber(pRange))
- end
- function refresh()
- clearHUDS(userhuds)
- broadcastHUD(userhuds,"Players Near Lab - ",1,1)
- broadcastHUD(userhuds,"In format of: ",1,11)
- broadcastHUD(userhuds,"USERNAME",1,30)
- broadcastHUD(userhuds,"DISTANCE",1,40)
- local i = 1
- for k, v in pairs(plrz) do
- for l, m in pairs(v) do
- i = i + 1
- broadcastHUD(userhuds,"["..tostring(m).."]",100,9+(i*10))
- end
- end
- end
- getPlayers()
- refresh()
- -- Detection Loop
- while true do
- sleep(0.01)
- local nplrz = getPlayers()
- if(plrz ~= nplrz)then
- plrz = nplrz
- refresh()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement