Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- repeat wait() until game.Players.LocalPlayer.Character and game.Players.LocalPlayer:findFirstChild("PlayerGui") and game.Workspace.CurrentCamera
- -- Put this script in the StarterGui.
- -- Then change the GroupId to your Group's Id.
- local GroupId = 0
- local plrgui = game.Players.LocalPlayer.PlayerGui
- local cam = game.Workspace.CurrentCamera
- function GG(v, char) if not v:IsA("Player") then return end
- repeat wait() until v and char and char:findFirstChild("Head")
- if v and v ~= game.Players.LocalPlayer and char and char:findFirstChild("Head") then
- local gui = Instance.new("BillboardGui", plrgui)
- if char.Head.Transparency == 0 then gui.Enabled = true else gui.Enabled = false end
- gui.Adornee = char.Head char.Head.Changed:connect(function() if char.Head.Transparency == 0 then gui.Enabled = true else gui.Enabled = false end end)
- gui.Size = UDim2.new(1,0,1,0)
- gui.StudsOffset = Vector3.new(0,3,0)
- gui.Name = "RankGui"
- local rank = Instance.new("TextLabel", gui)
- rank.Name = "Rank"
- rank.BackgroundTransparency = 1
- rank.ZIndex = 10
- rank.Font = "ArialBold"
- rank.Size = UDim2.new(1,0,1,0)
- rank.TextColor3 = v.TeamColor.Color v.Changed:connect(function() rank.TextColor3 = v.TeamColor.Color end)
- rank.TextStrokeColor3 = Color3.new(0,0,0)
- rank.TextStrokeTransparency = 0.5
- rank.FontSize = "Size8"
- rank.Visible = false
- rank.Text = "Unknown"
- coroutine.resume(coroutine.create(function()
- repeat
- if v:IsInGroup(GroupId) then
- rank.Text = v:GetRoleInGroup(GroupId)
- else
- rank.Text = "Unknown"
- end
- wait(1)
- until nil
- end))
- coroutine.wrap(function()
- repeat if (char.Head.Position - cam.CoordinateFrame.p).magnitude <= 100 then rank.Visible = true else rank.Visible = false end
- if (char.Head.Position - cam.CoordinateFrame.p).magnitude <= (100/7) then rank.FontSize = "Size18"
- elseif (char.Head.Position - cam.CoordinateFrame.p).magnitude <= (100/7)*2 then rank.FontSize = "Size14"
- elseif (char.Head.Position - cam.CoordinateFrame.p).magnitude <= (100/7)*3 then rank.FontSize = "Size12"
- elseif (char.Head.Position - cam.CoordinateFrame.p).magnitude <= (100/7)*4 then rank.FontSize = "Size11"
- elseif (char.Head.Position - cam.CoordinateFrame.p).magnitude <= (100/7)*5 then rank.FontSize = "Size10"
- elseif (char.Head.Position - cam.CoordinateFrame.p).magnitude <= (100/7)*6 then rank.FontSize = "Size9"
- elseif (char.Head.Position - cam.CoordinateFrame.p).magnitude <= 100 then rank.FontSize = "Size8"
- end wait(1/13.37)
- until v.Character ~= char end)()
- end
- end
- game.Players.ChildAdded:connect(function(v) v.CharacterAdded:connect(function(char) GG(v, char) end) end)
- for i,v in pairs(game.Players:children()) do coroutine.wrap(function() repeat wait() until v.Character GG(v, v.Character) end)() v.CharacterAdded:connect(function(char) GG(v, char) end) end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement