Hello!
I’ve made a Gui that goes over the players head with icons too!
Images
Items
There are 2 scripts with this pack. The 1st is for a player without a group. The 2nd is a player with a group.
/
Set up
Put the script in ServerScriptService
. Then put the BillboardGui in ServerStorage
. Delete the other script that you have.
Code
Code in the scripts uses a function to see if a player has Premium. This function has not been tested.
Group Script
How to get the GroupID
-- Services
local ServerStorage = game:GetService("ServerStorage")
local Players = game:GetService("Players")
-- Locals
local PlayerName = ServerStorage:WaitForChild("PlayerName")
local DisplayName = PlayerName.Background.Player.Display.DisplayName
local Username = PlayerName.Background.Player.Username
local Friends = PlayerName.Background.Player.Holder["4Friends"]
local Premium = PlayerName.Background.Player.Holder["3Premium"]
local StarCreator = PlayerName.Background.Player.Holder["2StarCreator"]
local Developer = PlayerName.Background.Player.Holder["1Developer"]
--
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local PlayerNameClone = PlayerName:Clone()
PlayerNameClone.Parent = Character.Head
PlayerNameClone.Background.Player.Display.DisplayName.Text = Player.DisplayName
PlayerNameClone.Background.Player.Username.Text = "@"..Player.Name
Character:WaitForChild("Humanoid").DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
Players.PlayerMembershipChanged:Connect(function()
if Player.MembershipType == Enum.MembershipType.Premium then
Friends.Visible = false
Premium.Visible = true
StarCreator.Visible = false
Developer.Visible = false
elseif Player.MembershipType == Enum.MembershipType.None then
Friends.Visible = false
Premium.Visible = false
StarCreator.Visible = false
Developer.Visible = false
end
end)
-- Checking rank
if Player:GetRankInGroup(GroupID) == 255 or Player:GetRankInGroup(GroupID) == 254 or Player:GetRankInGroup(GroupID) == 253 then -- See if a player is a rank in a group
Friends.Visible = false
Premium.Visible = false
StarCreator.Visible = false
Developer.Visible = true
elseif Player:GetRankInGroup(GroupID) == 252 then
Friends.Visible = true
Premium.Visible = false
StarCreator.Visible = false
Developer.Visible = false
end
if Player:IsInGroup(4199740) then -- This is to see if a player is in the star program
Friends.Visible = false
Premium.Visible = false
StarCreator.Visible = true
Developer.Visible = false
end
if Friends.Visible == false and Premium.Visible == false and StarCreator.Visible == false and Developer.Visible == false then
DisplayName.TextXAlignment = Enum.TextXAlignment.Right
Username.TextXAlignment = Enum.TextXAlignment.Right
end
end)
end)
Non Group Script
-- Services
local ServerStorage = game:GetService("ServerStorage")
local Players = game:GetService("Players")
-- Locals
local PlayerName = ServerStorage:WaitForChild("PlayerName")
local DisplayName = PlayerName.Background.Player.Display.DisplayName
local Username = PlayerName.Background.Player.Username
local Friends = PlayerName.Background.Player.Holder["4Friends"]
local Premium = PlayerName.Background.Player.Holder["3Premium"]
local StarCreator = PlayerName.Background.Player.Holder["2StarCreator"]
local Developer = PlayerName.Background.Player.Holder["1Developer"]
--
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local PlayerNameClone = PlayerName:Clone()
PlayerNameClone.Parent = Character.Head
PlayerNameClone.Background.Player.Display.DisplayName.Text = Player.DisplayName
PlayerNameClone.Background.Player.Username.Text = "@"..Player.Name
Character:WaitForChild("Humanoid").DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
Players.PlayerMembershipChanged:Connect(function()
if Player.MembershipType == Enum.MembershipType.Premium then
Friends.Visible = false
Premium.Visible = true
StarCreator.Visible = false
Developer.Visible = false
elseif Player.MembershipType == Enum.MembershipType.None then
Friends.Visible = false
Premium.Visible = false
StarCreator.Visible = false
Developer.Visible = false
end
end)
-- Game owner
if Player.UserId == game.CreatorId then
Friends.Visible = false
Premium.Visible = false
StarCreator.Visible = false
Developer.Visible = true
end
if Player:IsInGroup(4199740) then -- This is to see if a player is in the star program
Friends.Visible = false
Premium.Visible = false
StarCreator.Visible = true
Developer.Visible = false
end
if Friends.Visible == false and Premium.Visible == false and StarCreator.Visible == false and Developer.Visible == false then
DisplayName.TextXAlignment = Enum.TextXAlignment.Right
Username.TextXAlignment = Enum.TextXAlignment.Right
end
end)
end)