So I own a SCPF and I am making a game for it, and I got to the point I needed to add nametags for it.
So I tried but failed and I will post the script in a minute, but I need to know how to make it so where a person, joins a teams/switches and it will show the rank of that group, for example - Jim is in the main group and the Security Department, he goes on the Security Department and it shows his rank for the Security Department.
So I can’t figure that out so any help is appreciated. (Note: Do not point out any grammar mistakes, it’s annoying getting notified and check and it’s just someone saying “Misspelled that.” and if you don’t understand then I will reply and try to explain the best I can… Here is the script)
game.Players.PlayerAdded:Connect(onPlayerRespawned)
function onPlayerRespawned(newPlayer)
wait(0.01)
local gui = script.Rank:clone()
gui.Parent=newPlayer.Character.Head
gui.Adornee=newPlayer.Character.Head
local texta=gui.Frame.PlayerRank
texta.Text = (newPlayer:GetRoleInGroup(7954411))
local textb=gui.Frame.PlayerName
textb.Text = newPlayer.Name
wait(.001)
-- Departments
if newPlayer.TeamColor == game.Teams["Manufacturing Department"].TeamColor then
texta.Text = (newPlayer:GetRoleInGroup(N/A))
-- texta.TextColor3 = Color3.new(255, 176, 0)
elseif newPlayer.TeamColor == game.Teams["Department of External Affairs"].TeamColor then
texta.Text = (newPlayer:GetRoleInGroup(7954714))
-- texta.TextColor3 = Color3.new(255, 176, 0)
elseif newPlayer.TeamColor == game.Teams["Ethics Committee"].TeamColor then
texta.Text = (newPlayer:GetRoleInGroup(N/A))
-- texta.TextColor3 = Color3.new(39, 70, 45)
elseif newPlayer.TeamColor == game.Teams["Internal Security Department"].TeamColor then
texta.Text = (newPlayer:GetRoleInGroup(7955170))
-- texta.TextColor3 = Color3.new(163, 75, 75)
elseif newPlayer.TeamColor == game.Teams["Medical Department"].TeamColor then
texta.Text = (newPlayer:GetRoleInGroup(N/A))
-- texta.TextColor3 = Color3.new(4, 175, 236)
elseif newPlayer.TeamColor == game.Teams["Mobile Task Force"].TeamColor then
texta.Text = (newPlayer:GetRoleInGroup(N/A))
-- texta.TextColor3 = Color3.new(0, 32, 96)
elseif newPlayer.TeamColor == game.Teams["Rapid Response Team"].TeamColor then
texta.Text = (newPlayer:GetRoleInGroup(7955226))
-- texta.TextColor3 = Color3.new(117, 0, 0)
elseif newPlayer.TeamColor == game.Teams["Intelligence Agency"].TeamColor then
texta.Text = (newPlayer:GetRoleInGroup(7955063))
-- texta.TextColor3 = Color3.new(151, 0, 0)
elseif newPlayer.TeamColor == game.Teams["Scientific Department"].TeamColor then
texta.Text = (newPlayer:GetRoleInGroup(N/A))
-- texta.TextColor3 = Color3.new(13, 105, 172)
elseif newPlayer.TeamColor == game.Teams["Security Department"].TeamColor then
texta.Text = (newPlayer:GetRoleInGroup(N/A))
-- texta.TextColor3 = Color3.new(91, 93, 105)
elseif newPlayer.TeamColor == game.Teams["Foundation Personnel"].TeamColor then
texta.Text = (newPlayer:GetRoleInGroup(7954411))
-- texta.TextColor3 = Color3.new(202, 203, 209)
elseif newPlayer.TeamColor == game.Teams["Class-D"].TeamColor then
texta.Text = "Class-D"
--texta.TextColor3 = Color3.new(255, 85, 0)
end
-- Customs [SiD+]
while wait(1) do
if newPlayer.Name == "N/A" then
--SiD
textb.Text = "N/A"
elseif newPlayer.Name == "[The Administrator]" then
--MTF
textb.Text = "O5-1"
texta.Text = "[CLASSIFIED]"
elseif newPlayer.Name == "" then
--ScD
textb.Text = "O5-2"
texta.Text = "[CLASSIFIED]"
elseif newPlayer.Name == "" then
--SD
textb.Text = "O5-3"
texta.Text = "[CLASSIFIED]"
elseif newPlayer.Name == "" then
--MD
textb.Text = "O5-4"
texta.Text = "[CLASSIFIED]"
elseif newPlayer.Name == "" then
--EC
textb.Text = "O5-5"
texta.Text = "[CLASSIFIED]"
elseif newPlayer.Name == "" then
--E&T
textb.Text = "O5-6"
texta.Text = "[CLASSIFIED]"
elseif newPlayer.Name == "" then
--IA
textb.Text = "O5-7"
texta.Text = "[CLASSIFIED]"
elseif newPlayer.Name == "" then
--ISD
textb.Text = "O5-8"
texta.Text = "[CLASSIFIED]"
elseif newPlayer.Name == "" then
--PO
textb.Text = "O5-9"
texta.Text = "[CLASSIFIED]"
elseif newPlayer.Name == "" then
--MaD
textb.Text = "O5-10"
texta.Text = "[CLASSIFIED]"
elseif newPlayer.Name == "pupik22822" then
--O5-X
textb.Text = "Pupik22822"
texta.Text = "O5-Head"
elseif newPlayer.Name == "WizardlyChap4514" then
--The Administrator
textb.Text = "WizardlyChap4514"
texta.Text = "[The Administrator]"
elseif newPlayer.Name == "WizardlyChap4514" then
--N/A
textb.Text = "N/A"
texta.Text = "Blank"
end
end
end
function onPlayerEntered(newPlayer)
newPlayer.Changed:connect(function (property)
if (property == "Character") then
onPlayerRespawned(newPlayer)
end
end)
end
game.Players.PlayerAdded:connect(onPlayerEntered)
(Note: This is not my script, but it doesn’t work so need some help)
The Error is when a person joins a team it will just show the main group rank.