Overhead GUI for certain users with UserID

Hello,

I want to make a overhead gui for certain users i put in a list of userID’s but i don’t know how to do that.
Could anyone help me out? Thanks!

Here’s an example script of how you could do this:

local authorizedIDs = {123,456,789} – Change to target UserIDs
if table.find(authorizedIDs,player.UserId) then
print(“User is authorized”)
end

3 Likes

I have some errors when i try using this, is this normal?

Script in ServerScriptService :

local Players = game:GetService("Players")

local ID = {1} -- Example

Players.PlayerAdded:Connect(function(Player)
  if table.find(ID, Player.UserID) then
    print(Player.Name .. " is authorized")
  end
end)

Also, make sure to close the if statement with an end.

1 Like

How can i make the billboard gui get attached to the player’s head?

1 Like

Nvm, i got it to work. Thank you!

1 Like
local players = game:GetService("Players")
local server = game:GetService("ServerStorage")
local overHeadGui = server.OverheadGui

local whiteListedIds = {1, 2, 3} --Add IDs here.

players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		if not player:HasAppearanceLoaded() then
			player.CharacterAppearanceLoaded:Wait()
		end
		
		if table.find(whiteListedIds, player.UserId) then
			local head = character:WaitForChild("Head")
			local overHeadGuiClone = overHeadGui:Clone()
			overHeadGuiClone.Adornee = head
			overHeadGuiClone.Parent = head
		end
	end)
end)
2 Likes