Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local player = Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- -- Destroy old UI if it exists
- if player:FindFirstChild("PlayerGui"):FindFirstChild("NameChangerUI") then
- player.PlayerGui:FindFirstChild("NameChangerUI"):Destroy()
- end
- -- GUI Setup
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "NameChangerUI"
- screenGui.ResetOnSpawn = false
- screenGui.Parent = player:WaitForChild("PlayerGui")
- local frame = Instance.new("Frame")
- frame.Name = "MainFrame"
- frame.Size = UDim2.new(0, 270, 0, 130)
- frame.Position = UDim2.new(0.5, -135, 0.4, 0)
- frame.BackgroundColor3 = Color3.fromRGB(25, 25, 35)
- frame.BackgroundTransparency = 0.1
- frame.BorderSizePixel = 0
- frame.Active = true
- frame.Draggable = true
- frame.Parent = screenGui
- -- Rounded futuristic frame corners
- local corner = Instance.new("UICorner")
- corner.CornerRadius = UDim.new(0, 16)
- corner.Parent = frame
- -- Glow effect (optional)
- local glow = Instance.new("UIStroke")
- glow.Thickness = 2
- glow.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- glow.Color = Color3.fromRGB(60, 160, 255)
- glow.Transparency = 0.2
- glow.Parent = frame
- -- TextBox input
- local textBox = Instance.new("TextBox")
- textBox.PlaceholderText = "Enter new name"
- textBox.Text = ""
- textBox.Size = UDim2.new(0.85, 0, 0, 36)
- textBox.Position = UDim2.new(0.075, 0, 0.2, 0)
- textBox.BackgroundColor3 = Color3.fromRGB(35, 35, 55)
- textBox.TextColor3 = Color3.new(1, 1, 1)
- textBox.Font = Enum.Font.FredokaOne
- textBox.TextScaled = true
- textBox.ClearTextOnFocus = false
- textBox.Parent = frame
- local boxCorner = Instance.new("UICorner")
- boxCorner.CornerRadius = UDim.new(0, 10)
- boxCorner.Parent = textBox
- -- Button
- local button = Instance.new("TextButton")
- button.Text = "Change Name"
- button.Size = UDim2.new(0.85, 0, 0, 36)
- button.Position = UDim2.new(0.075, 0, 0.63, 0)
- button.BackgroundColor3 = Color3.fromRGB(0, 136, 255)
- button.TextColor3 = Color3.new(1, 1, 1)
- button.Font = Enum.Font.FredokaOne
- button.TextScaled = true
- button.Parent = frame
- local btnCorner = Instance.new("UICorner")
- btnCorner.CornerRadius = UDim.new(0, 10)
- btnCorner.Parent = button
- -- Button function
- button.MouseButton1Click:Connect(function()
- local newName = textBox.Text
- if newName ~= "" and character then
- local head = character:FindFirstChild("Head")
- if head then
- local overhead = head:FindFirstChild("Overhead") or Instance.new("BillboardGui", head)
- overhead.Name = "Overhead"
- overhead.Adornee = head
- overhead.Size = UDim2.new(0, 200, 0, 50)
- overhead.StudsOffset = Vector3.new(0, 2.5, 0)
- overhead.AlwaysOnTop = true
- local label = overhead:FindFirstChild("CustomName") or Instance.new("TextLabel", overhead)
- label.Name = "CustomName"
- label.Size = UDim2.new(1, 0, 1, 0)
- label.BackgroundTransparency = 1
- label.TextColor3 = Color3.fromRGB(255, 255, 255)
- label.TextStrokeTransparency = 0.2
- label.Text = newName
- label.TextScaled = true
- label.Font = Enum.Font.FredokaOne
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement