function GetPing()

local ping = 300-((1/wait())*10)

if ping < 1 then

ping = 1

elseif ping > 300 then

ping = 300

end

return math.floor(ping)

end

function GetGUINumber()

local number = (GetPing()/300)

if number > 1 then

return 1

else

return number

end

end

while wait(0.25) do

local X = ((1-wait())*0.75)

local R = GetGUINumber()

local G = (1-GetGUINumber())

script.Parent.MainFrame.PingChart.Size = UDim2.new(X,0,0.75,0)

script.Parent.MainFrame.PingChart.BackgroundColor3 = Color3.new(R,G,0)

script.Parent.MainFrame.PingText.Text = "Ping: "..GetPing()

end -- I have this but the numbers are random and not the real ping.

5 comments

0

why post this irrelevant script if its not even correlating with your question...? 

1

How is this irrelevant?

0

You could have the client ping to the server (via a remote), and get the difference of time with tick.

0

Might want to check out different pages on the same topic: https://scriptinghelpers.org/questions/24578/is-it-possible-to-get-the-ping-of-a-player

0

Thank you.