null nil false JohnConsole print 'Admin Console 1.0 Loaded' --[[ Hio. Make sure you have the latest and greatest version of this tool. Get it at http://ironnoob.com/forums/index.php/board,26.0.html - John Shedletsky ]]-- -- Install Gui local copy = script.JohnsConsoleGui:Clone() --copy.Archivable = false copy.Parent = game.StarterGui local lastPing = {} -- {player, ms} function split(str, delimiter) local result = { } local from = 1 local delim_from, delim_to = string.find( str, delimiter, from ) while delim_from do table.insert( result, string.sub( str, from , delim_from-1 ) ) from = delim_to + 1 delim_from, delim_to = string.find( str, delimiter, from ) end table.insert( result, string.sub( str, from ) ) return result end function getAvgPing() local p = game.Players:GetPlayers() local total = 0 for i=1,#p do if lastPing[p[i].Name] ~= nil then total = total + lastPing[p[i].Name] end end if #p == 0 then return 0 end return total / #p end function incomingMessage(msg) if string.sub(msg.Name, 1, 4) == "ping" then --print("SERV MSG: " .. msg.Value) local args = split(msg.Value, ",") --print("player: " .. args[1] .. "ping: " .. args[2]) lastPing[args[1]] = args[2] local result = getAvgPing() --print("avg ping: " .. result) msg.Value = "." .. result end end script.ChildAdded:connect(incomingMessage) JohnsConsoleGui false 4288914085 0 4279970357 1 false false Frame 0 5 0.5 0 0 150 0 120 0 3 true 1 false 4288914085 1 4279970357 1 false false 1 4 Ping 0 0 0 20 0 90 0 20 0 Your Ping: xxx ms 4294967295 false 4278190080 1 0 false 0 1 true 1 false 4288914085 1 4279970357 1 false false 2 5 Lag Meter 0 0 0 0 0 100 0 15 0 John's Lag Meter 4289331455 false 4278190080 1 0 false 2 1 true 1 false 4278255360 0 4279970357 0 false false 0 0 Bar 0 0 0 65 0 5 0 40 0 4279970357 false 4278190080 1 0 false 2 1 true 1 false 4288914085 1 4279970357 1 false false 1 4 ServerAvg 0 0 0 40 0 90 0 20 0 Server Avg: xxx ms 4294967295 false 4278190080 1 0 false 0 1 true 1 true true 4288914085 0 4279970357 1 false false http://www.roblox.com/asset/?id=25600854 false HelpButton 0 115 0 0 false 0 20 0 20 0 0 true 1 false LocalScript script.Parent.MouseButton1Click:connect(function() script.Parent.Parent.Parent.HelpFrame.Visible = true end) false ConsoleManager print 'Console GUI Manager 1.0 Loading' local numBars = 20 local cur = 0 local bars = {} local times = {} local bar = script.Parent.Frame.Bar:Clone() script.Parent.Frame.Bar:Remove() function doPing(lastPing) if lastPing == nil then lastPing = 0 end local msg = Instance.new("StringValue") msg.Value = game.Players.LocalPlayer.Name .. "," .. lastPing msg.Name = "ping" .. game.Players.LocalPlayer.userId local t = time() msg.Parent = game.Workspace.JohnConsole while msg.Value:sub(1,1) ~= '.' do wait() end local avgTime = msg.Value:sub(2) local dt = time() - t msg:Remove() return dt, avgTime end function setup() for i = 1, numBars do bars[i] = bar:Clone() bars[i].Position = UDim2.new(bars[i].Position.X.Scale, i * (bars[i].Size.X.Offset + 1), bars[i].Position.Y.Scale, bars[i].Position.Y.Offset) bars[i].Parent = script.Parent.Frame end end function drawGraph() local maxTime = .0001 for i = cur, cur-numBars, -1 do if i == 0 then break end if times[i] > maxTime then maxTime = times[i] end end for i = 1,numBars do if cur - i + 1 < 1 then bars[i].BackgroundTransparency = 1 else bars[i].BackgroundTransparency = 0 bars[i].Size = UDim2.new(bars[i].Size.X.Scale, bars[i].Size.X.Offset, bars[i].Size.Y.Scale, bar.Size.Y.Offset * (times[cur - i + 1] / maxTime)) bars[i].Position = UDim2.new(bars[i].Position.X.Scale, bars[i].Position.X.Offset, bar.Position.Y.Scale, bar.Position.Y.Offset + (45 - bars[i].Size.Y.Offset)) local c = Color3.new(0,1,0) if times[cur-i+1] > .2 then c = Color3.new(1,1,0) end if times[cur-i+1] > .4 then c = Color3.new(1,.5,0) end if times[cur-i+1] > .6 then c = Color3.new(1,0,0) end bars[i].BackgroundColor3 = c end end end setup() while true do wait(1) local pingSeconds local avgTime pingSeconds, avgTime = doPing(times[cur]) cur = cur + 1 times[cur] = pingSeconds script.Parent.Frame.Ping.Text = "Your Ping: " .. string.format("%u",pingSeconds * 1000) .. " ms" script.Parent.Frame.ServerAvg.Text = "Server Avg: " .. string.format("%u",avgTime * 1000) .. " ms" drawGraph() end false 4288914085 0 4279970357 1 false false HelpFrame 0.5 -300 0.5 -240 0 600 0 480 0 3 false 1 false 4288914085 1 4279970357 1 false false 2 8 Lag Meter 0 0 0 0 1 0 0 30 0 John's Lag Meter 4289331455 false 4278190080 1 0 false 2 1 true 1 false 4288914085 1 4279970357 1 false false 2 6 Version 0 0 0 40 1 0 0 30 0 Version 1.0 ---- Oct 31, 2012 4294967295 false 4278190080 1 0 false 2 1 true 1 true true 4289331455 0 4279970357 1 false false 2 8 false OkButton 0 240 0 400 false 0 120 0 40 0 0 Ok 4294967295 false 4278190080 1 0 false 2 1 true 1 false LocalScript script.Parent.MouseButton1Click:connect(function() script.Parent.Parent.Visible = false end) false 4288914085 1 4279970357 1 false false http://www.roblox.com/asset?id=96562773 ImageLabel 0 180 0 100 0 230 0 28 0 true 1 false 4288914085 1 4279970357 1 false false 2 6 About1 0 0 0 160 1 0 0 150 0 This tool is designed to help game developers profile the lag in their levels. It shows you two things: 1) your current ping (with a historical graph) and 2) the average ping of all clients attached to the server. Ping is the round-trip time it takes for a change to the ROBLOX DataModel to reach the server and be broadcast back to all players, measured in milliseconds. Anything over 200 ms is bad. 100 ms is good. 4294967295 false 4278190080 1 0 true 0 0 true 1 false 4288914085 1 4279970357 1 false false 2 6 About2 0 0 0 290 1 0 0 150 0 DOWNLOAD your own copy of the lag meter in the "ROBLOX > Free Stuff" subforum at IronNoob.com. Do you have your own handy developer tools that you're willing to share? Upload them to IronNoob.com! 4294967295 false 4278190080 1 0 true 0 0 true 1