Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = owner
- local char = nil
- local ptext,pchart
- local gp = 0
- local ggn = 0
- local xx = 0.3
- plr.CharacterAdded:Connect(function(character)
- char = character
- setup(char)
- end)
- spawn(function()
- local pos = nil
- local torso = nil
- local tempchar = plr.Character
- if tempchar then
- torso = tempchar:FindFirstChild('Torso')
- pos = torso.CFrame
- end
- plr:LoadCharacter()
- tempchar = plr.Character
- if tempchar and pos then
- torso = tempchar:FindFirstChild('Torso')
- if torso then
- torso.CFrame = pos
- end
- end
- start()
- print("Loaded KrYn0MoRe's Ping Display v2")
- end)
- function setup(char)
- local head = char:FindFirstChild('Head')
- local BillboardGui0 = Instance.new("BillboardGui")
- local Frame1 = Instance.new("Frame")
- ptext = Instance.new("TextBox")
- local ImageLabel3 = Instance.new("ImageLabel")
- pchart = Instance.new("Frame")
- BillboardGui0.Name = "PingGui"
- BillboardGui0.Parent = head
- BillboardGui0.Size = UDim2.new(3, 0, 0.8, 0)
- BillboardGui0.StudsOffset = Vector3.new(0, 2.5, 0)
- Frame1.Parent = BillboardGui0
- Frame1.Size = UDim2.new(1, 0, 1, 0)
- Frame1.BackgroundColor3 = Color3.new(0, 0, 0)
- Frame1.BorderColor = BrickColor.new("Institutional white")
- Frame1.BorderColor3 = Color3.new(1, 1, 1)
- ptext.Name = "Ping"
- ptext.Parent = Frame1
- ptext.Size = UDim2.new(0.7, 0, 1, 0)
- ptext.BackgroundColor = BrickColor.new("Institutional white")
- ptext.BackgroundColor3 = Color3.new(1, 1, 1)
- ptext.BackgroundTransparency = 1
- ptext.Font = Enum.Font.SourceSans
- ptext.FontSize = Enum.FontSize.Size14
- ptext.Text = (gp .. " ms")
- ptext.TextColor = BrickColor.new("Institutional white")
- ptext.TextColor3 = Color3.new(1, 1, 1)
- ptext.TextScaled = true
- ptext.TextSize = 14
- ptext.TextStrokeTransparency = 0
- ptext.TextWrap = true
- ptext.TextWrapped = true
- ImageLabel3.Name = "Overlay"
- ImageLabel3.Parent = Frame1
- ImageLabel3.Position = UDim2.new(0.7, 0, 0, 0)
- ImageLabel3.Size = UDim2.new(0.3, 0, 1, 0)
- ImageLabel3.BackgroundTransparency = 1
- ImageLabel3.ZIndex = 2
- ImageLabel3.Image = "rbxassetid://86319878"
- pchart.Name = "PingChart"
- pchart.Parent = Frame1
- pchart.Position = UDim2.new(0.7, 0, 0, 0)
- pchart.Size = UDim2.new(0.3, 0, 1, 0)
- pchart.BackgroundColor = BrickColor.new("Lime green")
- pchart.BackgroundColor3 = Color3.new(0, 1, 0)
- pchart.BorderSizePixel = 0
- end
- function start()
- spawn(function()
- while wait(0.25) do
- if pchart and pchart.Parent and ptext and ptext.Parent then
- local ping = math.floor(plr:GetNetworkPing()*1000)
- local X = 0.3 --xx
- local R = math.clamp(ping/300,0,1)
- local G = (1-R)
- pchart.Size = UDim2.new(X,0,1,0)
- pchart.BackgroundColor3 = Color3.new(R,G,0)
- ptext.Text = (ping .. ' ms')
- end
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement