Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local configurationModule = require(game.ReplicatedStorage:WaitForChild("Configuration"))
- local group = {configurationModule.GroupId, configurationModule.MiddleRank, configurationModule.HighRank}
- local tweenService = game:GetService("TweenService")
- local Players = game:GetService("Players")
- local datastoreService = game:GetService("DataStoreService")
- local OrdersBase = datastoreService:GetOrderedDataStore("Orders")
- -- SetUp Nametag Function
- function setupNametag(Player, Character)
- local NametagObject = game.ServerStorage:WaitForChild("NameTag")
- local info = TweenInfo.new(1.5, Enum.EasingStyle.Back, Enum.EasingDirection.InOut)
- local info2 = TweenInfo.new(.8, Enum.EasingStyle.Back, Enum.EasingDirection.Out)
- local PlayerName = Player.Name
- local PlayerDisplayName = Player.DisplayName
- local PlayerRole
- local PlayerRank = Player:GetRankInGroup(group[1])
- local ForceField = Character:FindFirstChildWhichIsA("ForceField")
- pcall(function()
- PlayerRole = Player:GetRoleInGroup(group[1])
- end)
- local Head = Character:FindFirstChild("Head")
- local Humanoid = Character:WaitForChild("Humanoid")
- if Head then
- local NametagClone = NametagObject:Clone()
- NametagClone.Parent = Player.Character.HumanoidRootPart
- NametagClone.StudsOffset = Vector3.new(0, Character.Head.Size.Y, 0) + Vector3.new(0, 2.5, 0)
- NametagClone.Name = PlayerName
- NametagClone.Frame.Username.Text = PlayerName
- NametagClone.Frame.Rank.Text = PlayerRole
- local RankTag = NametagClone.Frame.Rank
- local NameTag = NametagClone.Frame.Username
- local IconsFrame = NametagClone.Frame.Icons
- local tween1 = tweenService:Create(NameTag, info, {Position = UDim2.new(0, 0, 0.25, 0)})
- local tween2 = tweenService:Create(RankTag, info, {Position = UDim2.new(0, 0, 0.5, 0)})
- local tween3 = tweenService:Create(IconsFrame, info, {Position = UDim2.new(0.054, 0, 0, 0)})
- tween1:Play()
- tween2:Play()
- tween3:Play()
- tween3.Completed:Wait()
- Humanoid.DisplayDistanceType = "None"
- local Images = NametagClone.Frame.Icons
- if Player:GetRankInGroup(group[1]) == configurationModule.Owner then
- local colorTween = tweenService:Create(NameTag, info2, {TextColor3 = Color3.fromRGB(76, 118, 255)})
- colorTween:Play()
- end
- if Player.UserId == 1788016643 then
- local colorTween = tweenService:Create(NameTag, info2, {TextColor3 = Color3.fromRGB(188, 170, 241)})
- colorTween:Play()
- end
- if Player.UserId == 1782889630 then
- local colorTween = tweenService:Create(NameTag, info2, {TextColor3 = Color3.fromRGB(52, 59, 91)})
- colorTween:Play()
- end
- if Player:GetRankInGroup(group[1]) == configurationModule.Contributor then
- local colorTween = tweenService:Create(NameTag, info2, {TextColor3 = Color3.fromRGB(209, 177, 13)})
- colorTween:Play()
- end
- if Player.UserId == 1788016643 or Player:GetRankInGroup(configurationModule.GroupId) == configurationModule.Owner then
- Images.Pirate.Visible = true
- end
- if Player:GetRankInGroup(configurationModule.GroupId) >= configurationModule.HighRank then
- Images.Executive.Visible = true
- end
- if Player:GetRankInGroup(configurationModule.GroupId) >= configurationModule.MiddleRank then
- Images.Staff.Visible = true
- end
- if Player:GetRankInGroup(configurationModule.GroupId) == configurationModule.Represenative then
- Images.Represenative.Visible = true
- end
- if Player:GetRankInGroup(configurationModule.GroupId) == configurationModule.DeveloperRank or Player:GetRankInGroup(configurationModule.GroupId) == configurationModule.Owner then
- Images.Developer.Visible = true
- end
- wait(.5)
- for Index, Image in pairs(IconsFrame:GetChildren()) do -- Must always be at the end of the script
- if Image:IsA("ImageLabel") then
- local imageTransparencyTween = tweenService:Create(Image, info, {ImageTransparency = 0})
- imageTransparencyTween:Play()
- end
- end
- end
- end
- function setupStaff(Player)
- if Player:GetRankInGroup(group[1]) >= group[2] and Player:GetRankInGroup(group[1]) < group[3] then
- local staffFolder = script.Staff:Clone()
- staffFolder.Orders.Value = OrdersBase:GetAsync(Player.UserId)
- staffFolder.Parent = Player
- elseif Player:GetRankInGroup(group[1]) >= group[3] then
- local hour = DateTime.now():FormatUniversalTime("HH", "en-us")
- local minute = DateTime.now():FormatUniversalTime("mm", "en-us")
- local second = DateTime.now():FormatUniversalTime("ss", "en-us")
- local staffFolder = script.Staff:Clone()
- staffFolder.Parent = Player
- staffFolder.OrdersCreated.Value = OrdersBase:GetAsync(Player.UserId)
- staffFolder.JoinTime.Value = hour .. ":" .. minute .. ":" .. second
- print(Player.Staff.OrdersCreated.Value)
- print(Player.Staff.JoinTime.Value)
- end
- end
- -- Player Added Function
- Players.PlayerAdded:Connect(function(Player)
- print(configurationModule.GroupId)
- print(configurationModule.Owner)
- setupNametag(Player, Player.Character);
- if Player:GetRankInGroup(configurationModule.GroupId) == configurationModule.Owner then
- print("Staff Joined")
- setupStaff(Player)
- end
- Player.CharacterAdded:Connect(function(char)
- if not char.HumanoidRootPart:FindFirstChild('NameTag') then
- setupNametag(Player, Player.Character or Player.CharacterAdded:Wait())
- end
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment