Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- LocalScript: Title Billboard (fixed)
- local Players = game:GetService("Players")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local RunService = game:GetService("RunService")
- local UserInputService = game:GetService("UserInputService")
- local TextService = game:GetService("TextService")
- local LP = Players.LocalPlayer
- local Camera = workspace.CurrentCamera
- local Config = require(ReplicatedStorage:WaitForChild("Config"))
- local AllTitles = {}
- -- Device icon
- local function getDeviceIconAsset()
- if UserInputService.GamepadEnabled then
- return "rbxassetid://84173963561612"
- elseif UserInputService.TouchEnabled and not UserInputService.KeyboardEnabled then
- return "rbxassetid://17617732507"
- else
- return "rbxassetid://12684119225"
- end
- end
- -- Gradient animasi 3 warna (kuning → merah → biru)
- local G1 = Color3.fromRGB(255, 230, 0) -- kuning
- local G2 = Color3.fromRGB(255, 60, 60) -- merah
- local G3 = Color3.fromRGB(60, 110, 255) -- biru
- -- Gradient rotasi 0° → 360°
- local function gradientRotation()
- return (tick() * 50) % 360 -- 40 = kecepatan rotasi
- end
- local function animatedGradient(t)
- local speed = 1.3 -- kecepatan animasi
- local a = (math.sin(t * speed) + 1) / 2
- local b = (math.sin(t * speed + 2) + 1) / 2
- local c = (math.sin(t * speed + 4) + 1) / 2
- return ColorSequence.new({
- ColorSequenceKeypoint.new(0, G1:Lerp(G2, a)), -- Kuning ke Merah
- ColorSequenceKeypoint.new(0.5, G2:Lerp(G3, b)), -- Merah ke Biru
- ColorSequenceKeypoint.new(1, G3:Lerp(G1, c)) -- Biru ke Kuning
- })
- end
- -- Rainbow (phase optional)
- local function smoothRGB(phase)
- local t = tick()
- phase = phase or 0
- return Color3.new((math.sin((t+phase)*2)+1)/2, (math.sin((t+phase)*2+2)+1)/2, (math.sin((t+phase)*2+4)+1)/2)
- end
- -- Rank
- local function getRank(summit)
- if summit>=1000 then return "⛰️ Arcane Ascendant", Color3.fromHSV(tick()%20/20,1,1)
- elseif summit>=550 then return "⚡ Mythic Peakbreaker", Color3.fromRGB(255,215,0)
- elseif summit>=450 then return "🔥 Apex Titanclimber", Color3.fromRGB(255,120,120)
- elseif summit>=300 then return "🌌 Divine Summitmaster", Color3.fromRGB(255,0,50)
- elseif summit>=250 then return "🌑 Phantom Ridgewalker", Color3.fromRGB(232,42,159)
- elseif summit>=100 then return "🌠 Legendary Crestborne", Color3.fromRGB(255,225,0)
- elseif summit>=50 then return "💫 Master Pinnacler", Color3.fromRGB(235,33,43)
- elseif summit>=40 then return "⭐ Elite Crestshaper", Color3.fromRGB(186,85,211)
- elseif summit>=30 then return "🔮 Arc Expert Climber", Color3.fromRGB(153,0,255)
- elseif summit>=20 then return "⚔️ Pro Summit Raider", Color3.fromRGB(30,144,255)
- elseif summit>=10 then return "🌿 Skilled Ridgewalker", Color3.fromRGB(189,232,35)
- elseif summit>=1 then return "🌄 Rookie Climber", Color3.fromRGB(113,214,36)
- else return "🌱 Downtol", Color3.fromRGB(145,66,38)
- end
- end
- -- Create Billboard for a player
- local function createBillboard(player)
- if not player then return end
- local char = player.Character or player.CharacterAdded:Wait()
- if not char then return end
- local head = char:WaitForChild("Head", 5)
- if not head then return end
- -- remove existing billboards to avoid duplicates
- for _,v in pairs(head:GetChildren()) do
- if v:IsA("BillboardGui") and v.Name == "TitleBillboard" then v:Destroy() end
- end
- local billboard = Instance.new("BillboardGui")
- billboard.Name = "TitleBillboard"
- billboard.Size = UDim2.fromOffset(220,160)
- billboard.Adornee = head
- billboard.AlwaysOnTop = true
- billboard.LightInfluence = 0
- billboard.ResetOnSpawn = false
- billboard.StudsOffset = Vector3.new(0,3.2,0)
- billboard.MaxDistance = Config.TitleMaxDistance or 30
- billboard.Parent = head
- local container = Instance.new("Frame")
- container.Size = UDim2.new(1,0,1,0)
- container.BackgroundTransparency = 1
- container.Parent = billboard
- local layout = Instance.new("UIListLayout")
- layout.HorizontalAlignment = Enum.HorizontalAlignment.Center
- layout.VerticalAlignment = Enum.VerticalAlignment.Center
- layout.SortOrder = Enum.SortOrder.LayoutOrder
- layout.Padding = UDim.new(0,2)
- layout.Parent = container
- local function newLabel(height, order, font)
- local t = Instance.new("TextLabel")
- t.Size = UDim2.new(1,0,0,height)
- t.BackgroundTransparency = 1
- t.TextScaled = true
- t.Font = font or Enum.Font.GothamSemibold
- t.TextColor3 = Color3.new(1,1,1)
- t.TextStrokeColor3 = Color3.new(0,0,0)
- t.TextStrokeTransparency = 0.3
- t.LayoutOrder = order
- t.Parent = container
- return t
- end
- -- Special (owner/admin) title
- local specialTitle = newLabel(18,2,Enum.Font.GothamBold)
- specialTitle.Text = ""
- -- We'll attach a UIGradient but store a reference
- local specialGradient = Instance.new("UIGradient")
- specialGradient.Rotation = 0
- specialGradient.Parent = specialTitle
- -- Name frame to hold icon (left) + name (right)
- local nameFrame = Instance.new("Frame")
- nameFrame.Size = UDim2.new(1,0,0,18)
- nameFrame.BackgroundTransparency = 1
- nameFrame.LayoutOrder = 3
- nameFrame.Parent = container
- local deviceIcon = Instance.new("ImageLabel")
- deviceIcon.Name = "DeviceIcon"
- deviceIcon.BackgroundTransparency = 1
- deviceIcon.Size = UDim2.new(0,18,0,18)
- deviceIcon.Position = UDim2.new(0,4,0,0) -- left padding
- deviceIcon.AnchorPoint = Vector2.new(0,0)
- deviceIcon.ScaleType = Enum.ScaleType.Fit
- deviceIcon.Parent = nameFrame
- local nameLabel = Instance.new("TextLabel")
- nameLabel.Name = "NameLabel"
- nameLabel.BackgroundTransparency = 1
- nameLabel.Size = UDim2.new(1, -28, 1, 0) -- leave room for icon on left
- nameLabel.Position = UDim2.new(0, 28, 0, 0)
- nameLabel.TextScaled = true
- nameLabel.Font = Enum.Font.GothamBold
- nameLabel.TextColor3 = Color3.new(1,1,1)
- nameLabel.TextStrokeColor3 = Color3.new(0,0,0)
- nameLabel.TextStrokeTransparency = 0.3
- nameLabel.Parent = nameFrame
- local rankTitle = newLabel(17,4)
- local summitLabel = newLabel(16,5)
- -- Save references
- AllTitles[player] = {
- Billboard = billboard,
- SpecialTitle = specialTitle,
- SpecialGradient = specialGradient,
- NameLabel = nameLabel,
- DeviceIcon = deviceIcon,
- RankTitle = rankTitle,
- SummitLabel = summitLabel
- }
- end
- local function updateBillboardScale(billboard, adornee)
- if not adornee or not adornee:IsDescendantOf(workspace) then return end
- local camPos = Camera.CFrame.Position
- local distance = (adornee.Position - camPos).Magnitude
- local scale = math.clamp(1 - (distance / 120), 0.35, 1)
- billboard.Size = UDim2.fromOffset(220 * scale, 160 * scale)
- end
- -- Update loop
- RunService.RenderStepped:Connect(function()
- for _, player in ipairs(Players:GetPlayers()) do
- if player.Character and player.Character.Parent and player.Character:FindFirstChild("Head") then
- if not AllTitles[player] then
- createBillboard(player)
- end
- local ui = AllTitles[player]
- if not ui or not ui.Billboard or not ui.NameLabel then continue end
- -- Summit value
- local summitVal = 0
- if player:FindFirstChild("leaderstats") and player.leaderstats:FindFirstChild("Summit") then
- summitVal = player.leaderstats.Summit.Value
- end
- -- Scaling & distance
- ui.Billboard.MaxDistance = Config.TitleMaxDistance or 40
- updateBillboardScale(ui.Billboard, player.Character:FindFirstChild("Head"))
- ui.DeviceIcon.Image = getDeviceIconAsset()
- ui.NameLabel.Text = string.format("%s (@%s)", player.DisplayName or player.Name, player.Name)
- local textWidth = 0
- pcall(function()
- local bounds = ui.NameLabel.TextBounds
- if bounds and bounds.X then
- textWidth = bounds.X
- end
- end)
- if textWidth <= 0 then
- local fontSize = 20
- local size = TextService:GetTextSize(ui.NameLabel.Text, fontSize, ui.NameLabel.Font, Vector2.new(1000,100))
- textWidth = size.X
- end
- ui.DeviceIcon.Position = UDim2.new(0, 7, 0, 0)
- ui.NameLabel.Position = UDim2.new(0, 28, 0, 0)
- ui.NameLabel.Size = UDim2.new(1, -28, 1, 0)
- -- Special Title (owner/admin)
- local text, col = "", Color3.new(1,1,1)
- if table.find(Config.OwnerUsernames or {}, player.Name) then
- text = Config.OwnerTitleName or "Owner"
- ui.SpecialTitle.Text = text
- ui.SpecialTitle.TextColor3 = Color3.new(1,1,1)
- ui.SpecialTitle.UIGradient.Color = animatedGradient(tick())
- ui.SpecialTitle.UIGradient.Rotation = gradientRotation()
- elseif table.find(Config.AdminUsernames or {}, player.Name) then
- text = Config.AdminTitleName or "Admin"
- col = Color3.fromRGB(7,209,245)
- ui.SpecialTitle.Text = text
- ui.SpecialGradient.Color = ColorSequence.new{
- ColorSequenceKeypoint.new(0, col),
- ColorSequenceKeypoint.new(1, col)
- }
- ui.SpecialTitle.TextColor3 = col
- else
- -- no special title
- ui.SpecialTitle.Text = ""
- ui.SpecialGradient.Color = ColorSequence.new{
- ColorSequenceKeypoint.new(0, Color3.new(1,1,1)),
- ColorSequenceKeypoint.new(1, Color3.new(1,1,1))
- }
- ui.SpecialTitle.TextColor3 = Color3.new(1,1,1)
- end
- -- Rank & Summit labels
- local rankName, rankColor = getRank(summitVal)
- ui.RankTitle.Text = rankName
- ui.RankTitle.TextColor3 = rankColor
- ui.SummitLabel.Text = "Summit: "..tostring(summitVal)
- end
- end
- end)
- print("[TitleName] Ready - Succes Loaded Title Name")
Advertisement
Add Comment
Please, Sign In to add comment