#Need help with Ping System

3 messages · Page 1 of 1 (latest)

ebon vectorBOT
#

studio** You are now Level 3! **studio

remote imp
#

need help for my game where it displays your ping all the scripts work but it only works in roblox studios and i need help fixing so it works for roblox because when i join my game it, it shows my ping over 2 million but in roblox studios it shows 50 ping and in my game i check my performance stats it was around 50 not 2 million ping

#

local script

local services = {
    ["run_service"] = game:GetService("RunService"),
    ["replicated_storage"] = game:GetService("ReplicatedStorage"),
    ["players"] = game:GetService("Players")
}

local remoteEvent = services["replicated_storage"]:WaitForChild("PingUpdate")
local player = services["players"].LocalPlayer

local function requestPing()
    local startTime = tick()
    remoteEvent:FireServer(startTime)
end

local last_update = tick()
local update_rate = 1

services["run_service"].RenderStepped:Connect(function()
    if tick() - last_update >= update_rate then
        requestPing()
        last_update = tick()
    end
end)