RXYSETTINGS

TitleName

Oct 31st, 2025 (edited)
1,189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.29 KB | Source Code | 0 0
  1. -- LocalScript: Title Billboard (fixed)
  2.  
  3. local Players = game:GetService("Players")
  4. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  5. local RunService = game:GetService("RunService")
  6. local UserInputService = game:GetService("UserInputService")
  7. local TextService = game:GetService("TextService")
  8.  
  9. local LP = Players.LocalPlayer
  10. local Camera = workspace.CurrentCamera
  11.  
  12. local Config = require(ReplicatedStorage:WaitForChild("Config"))
  13. local AllTitles = {}
  14.  
  15. -- Device icon
  16. local function getDeviceIconAsset()
  17.     if UserInputService.GamepadEnabled then
  18.         return "rbxassetid://84173963561612"
  19.     elseif UserInputService.TouchEnabled and not UserInputService.KeyboardEnabled then
  20.         return "rbxassetid://17617732507"
  21.     else
  22.         return "rbxassetid://12684119225"
  23.     end
  24. end
  25. -- Gradient animasi 3 warna (kuning → merah → biru)
  26. local G1 = Color3.fromRGB(255, 230, 0)   -- kuning
  27. local G2 = Color3.fromRGB(255, 60, 60)   -- merah
  28. local G3 = Color3.fromRGB(60, 110, 255)  -- biru
  29.  
  30. -- Gradient rotasi 0° → 360°
  31. local function gradientRotation()
  32.     return (tick() * 50) % 360   -- 40 = kecepatan rotasi
  33. end
  34.  
  35. local function animatedGradient(t)
  36.     local speed = 1.3  -- kecepatan animasi
  37.  
  38.     local a = (math.sin(t * speed) + 1) / 2
  39.     local b = (math.sin(t * speed + 2) + 1) / 2
  40.     local c = (math.sin(t * speed + 4) + 1) / 2
  41.  
  42.     return ColorSequence.new({
  43.         ColorSequenceKeypoint.new(0, G1:Lerp(G2, a)), -- Kuning ke Merah
  44.         ColorSequenceKeypoint.new(0.5, G2:Lerp(G3, b)), -- Merah ke Biru
  45.         ColorSequenceKeypoint.new(1, G3:Lerp(G1, c)) -- Biru ke Kuning
  46.     })
  47. end
  48. -- Rainbow (phase optional)
  49. local function smoothRGB(phase)
  50.     local t = tick()
  51.     phase = phase or 0
  52.     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)
  53. end
  54.  
  55. -- Rank
  56. local function getRank(summit)
  57.     if summit>=1000 then return "⛰️ Arcane Ascendant", Color3.fromHSV(tick()%20/20,1,1)
  58.     elseif summit>=550 then return "⚡ Mythic Peakbreaker", Color3.fromRGB(255,215,0)
  59.     elseif summit>=450 then return "🔥 Apex Titanclimber", Color3.fromRGB(255,120,120)
  60.     elseif summit>=300 then return "🌌 Divine Summitmaster", Color3.fromRGB(255,0,50)
  61.     elseif summit>=250 then return "🌑 Phantom Ridgewalker", Color3.fromRGB(232,42,159)
  62.     elseif summit>=100 then return "🌠 Legendary Crestborne", Color3.fromRGB(255,225,0)
  63.     elseif summit>=50 then return "💫 Master Pinnacler", Color3.fromRGB(235,33,43)
  64.     elseif summit>=40 then return "⭐ Elite Crestshaper", Color3.fromRGB(186,85,211)
  65.     elseif summit>=30 then return "🔮 Arc Expert Climber", Color3.fromRGB(153,0,255)
  66.     elseif summit>=20 then return "⚔️ Pro Summit Raider", Color3.fromRGB(30,144,255)
  67.     elseif summit>=10 then return "🌿 Skilled Ridgewalker", Color3.fromRGB(189,232,35)
  68.     elseif summit>=1 then return "🌄 Rookie Climber", Color3.fromRGB(113,214,36)
  69.     else return "🌱 Downtol", Color3.fromRGB(145,66,38)
  70.     end
  71. end
  72.  
  73. -- Create Billboard for a player
  74. local function createBillboard(player)
  75.     if not player then return end
  76.     local char = player.Character or player.CharacterAdded:Wait()
  77.     if not char then return end
  78.     local head = char:WaitForChild("Head", 5)
  79.     if not head then return end
  80.  
  81.     -- remove existing billboards to avoid duplicates
  82.     for _,v in pairs(head:GetChildren()) do
  83.         if v:IsA("BillboardGui") and v.Name == "TitleBillboard" then v:Destroy() end
  84.     end
  85.  
  86.     local billboard = Instance.new("BillboardGui")
  87.     billboard.Name = "TitleBillboard"
  88.     billboard.Size = UDim2.fromOffset(220,160)
  89.     billboard.Adornee = head
  90.     billboard.AlwaysOnTop = true
  91.     billboard.LightInfluence = 0
  92.     billboard.ResetOnSpawn = false
  93.     billboard.StudsOffset = Vector3.new(0,3.2,0)
  94.     billboard.MaxDistance = Config.TitleMaxDistance or 30
  95.     billboard.Parent = head
  96.  
  97.     local container = Instance.new("Frame")
  98.     container.Size = UDim2.new(1,0,1,0)
  99.     container.BackgroundTransparency = 1
  100.     container.Parent = billboard
  101.  
  102.     local layout = Instance.new("UIListLayout")
  103.     layout.HorizontalAlignment = Enum.HorizontalAlignment.Center
  104.     layout.VerticalAlignment = Enum.VerticalAlignment.Center
  105.     layout.SortOrder = Enum.SortOrder.LayoutOrder
  106.     layout.Padding = UDim.new(0,2)
  107.     layout.Parent = container
  108.  
  109.     local function newLabel(height, order, font)
  110.         local t = Instance.new("TextLabel")
  111.         t.Size = UDim2.new(1,0,0,height)
  112.         t.BackgroundTransparency = 1
  113.         t.TextScaled = true
  114.         t.Font = font or Enum.Font.GothamSemibold
  115.         t.TextColor3 = Color3.new(1,1,1)
  116.         t.TextStrokeColor3 = Color3.new(0,0,0)
  117.         t.TextStrokeTransparency = 0.3
  118.         t.LayoutOrder = order
  119.         t.Parent = container
  120.         return t
  121.     end
  122.  
  123.     -- Special (owner/admin) title
  124.     local specialTitle = newLabel(18,2,Enum.Font.GothamBold)
  125.     specialTitle.Text = ""
  126.     -- We'll attach a UIGradient but store a reference
  127.     local specialGradient = Instance.new("UIGradient")
  128.     specialGradient.Rotation = 0
  129.     specialGradient.Parent = specialTitle
  130.  
  131.     -- Name frame to hold icon (left) + name (right)
  132.     local nameFrame = Instance.new("Frame")
  133.     nameFrame.Size = UDim2.new(1,0,0,18)
  134.     nameFrame.BackgroundTransparency = 1
  135.     nameFrame.LayoutOrder = 3
  136.     nameFrame.Parent = container
  137.  
  138.     local deviceIcon = Instance.new("ImageLabel")
  139.     deviceIcon.Name = "DeviceIcon"
  140.     deviceIcon.BackgroundTransparency = 1
  141.     deviceIcon.Size = UDim2.new(0,18,0,18)
  142.     deviceIcon.Position = UDim2.new(0,4,0,0) -- left padding
  143.     deviceIcon.AnchorPoint = Vector2.new(0,0)
  144.     deviceIcon.ScaleType = Enum.ScaleType.Fit
  145.     deviceIcon.Parent = nameFrame
  146.  
  147.     local nameLabel = Instance.new("TextLabel")
  148.     nameLabel.Name = "NameLabel"
  149.     nameLabel.BackgroundTransparency = 1
  150.     nameLabel.Size = UDim2.new(1, -28, 1, 0) -- leave room for icon on left
  151.     nameLabel.Position = UDim2.new(0, 28, 0, 0)
  152.     nameLabel.TextScaled = true
  153.     nameLabel.Font = Enum.Font.GothamBold
  154.     nameLabel.TextColor3 = Color3.new(1,1,1)
  155.     nameLabel.TextStrokeColor3 = Color3.new(0,0,0)
  156.     nameLabel.TextStrokeTransparency = 0.3
  157.     nameLabel.Parent = nameFrame
  158.  
  159.     local rankTitle = newLabel(17,4)
  160.     local summitLabel = newLabel(16,5)
  161.  
  162.     -- Save references
  163.     AllTitles[player] = {
  164.         Billboard = billboard,
  165.         SpecialTitle = specialTitle,
  166.         SpecialGradient = specialGradient,
  167.         NameLabel = nameLabel,
  168.         DeviceIcon = deviceIcon,
  169.         RankTitle = rankTitle,
  170.         SummitLabel = summitLabel
  171.     }
  172. end
  173.  
  174. local function updateBillboardScale(billboard, adornee)
  175.     if not adornee or not adornee:IsDescendantOf(workspace) then return end
  176.  
  177.     local camPos = Camera.CFrame.Position
  178.     local distance = (adornee.Position - camPos).Magnitude
  179.     local scale = math.clamp(1 - (distance / 120), 0.35, 1)
  180.     billboard.Size = UDim2.fromOffset(220 * scale, 160 * scale)
  181. end
  182.  
  183. -- Update loop
  184. RunService.RenderStepped:Connect(function()
  185.     for _, player in ipairs(Players:GetPlayers()) do
  186.         if player.Character and player.Character.Parent and player.Character:FindFirstChild("Head") then
  187.             if not AllTitles[player] then
  188.                 createBillboard(player)
  189.             end
  190.             local ui = AllTitles[player]
  191.             if not ui or not ui.Billboard or not ui.NameLabel then continue end
  192.  
  193.             -- Summit value
  194.             local summitVal = 0
  195.             if player:FindFirstChild("leaderstats") and player.leaderstats:FindFirstChild("Summit") then
  196.                 summitVal = player.leaderstats.Summit.Value
  197.             end
  198.  
  199.             -- Scaling & distance
  200.             ui.Billboard.MaxDistance = Config.TitleMaxDistance or 40
  201.             updateBillboardScale(ui.Billboard, player.Character:FindFirstChild("Head"))
  202.             ui.DeviceIcon.Image = getDeviceIconAsset()
  203.             ui.NameLabel.Text = string.format("%s (@%s)", player.DisplayName or player.Name, player.Name)
  204.             local textWidth = 0
  205.             pcall(function()
  206.                 local bounds = ui.NameLabel.TextBounds
  207.                 if bounds and bounds.X then
  208.                     textWidth = bounds.X
  209.                 end
  210.             end)
  211.             if textWidth <= 0 then
  212.                 local fontSize = 20
  213.                 local size = TextService:GetTextSize(ui.NameLabel.Text, fontSize, ui.NameLabel.Font, Vector2.new(1000,100))
  214.                 textWidth = size.X
  215.             end
  216.  
  217.             ui.DeviceIcon.Position = UDim2.new(0, 7, 0, 0)
  218.             ui.NameLabel.Position = UDim2.new(0, 28, 0, 0)
  219.             ui.NameLabel.Size = UDim2.new(1, -28, 1, 0)
  220.  
  221.             -- Special Title (owner/admin)
  222.             local text, col = "", Color3.new(1,1,1)
  223.             if table.find(Config.OwnerUsernames or {}, player.Name) then
  224.                 text = Config.OwnerTitleName or "Owner"
  225.                 ui.SpecialTitle.Text = text
  226.                 ui.SpecialTitle.TextColor3 = Color3.new(1,1,1)
  227.                 ui.SpecialTitle.UIGradient.Color = animatedGradient(tick())
  228.                 ui.SpecialTitle.UIGradient.Rotation = gradientRotation()
  229.             elseif table.find(Config.AdminUsernames or {}, player.Name) then
  230.                 text = Config.AdminTitleName or "Admin"
  231.                 col = Color3.fromRGB(7,209,245)
  232.                 ui.SpecialTitle.Text = text
  233.                 ui.SpecialGradient.Color = ColorSequence.new{
  234.                     ColorSequenceKeypoint.new(0, col),
  235.                     ColorSequenceKeypoint.new(1, col)
  236.                 }
  237.                 ui.SpecialTitle.TextColor3 = col
  238.             else
  239.                 -- no special title
  240.                 ui.SpecialTitle.Text = ""
  241.                 ui.SpecialGradient.Color = ColorSequence.new{
  242.                     ColorSequenceKeypoint.new(0, Color3.new(1,1,1)),
  243.                     ColorSequenceKeypoint.new(1, Color3.new(1,1,1))
  244.                 }
  245.                 ui.SpecialTitle.TextColor3 = Color3.new(1,1,1)
  246.             end
  247.  
  248.             -- Rank & Summit labels
  249.             local rankName, rankColor = getRank(summitVal)
  250.             ui.RankTitle.Text = rankName
  251.             ui.RankTitle.TextColor3 = rankColor
  252.             ui.SummitLabel.Text = "Summit: "..tostring(summitVal)
  253.         end
  254.     end
  255. end)
  256. print("[TitleName] Ready - Succes Loaded Title Name")
Advertisement
Add Comment
Please, Sign In to add comment