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!
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
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.
Nvm, i got it to work. Thank you!
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)