Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local fpsCounter = script.Parent
- local lastTime = tick()
- local frameCount = 0
- game:GetService("RunService").RenderStepped:Connect(function()
- frameCount = frameCount + 1
- local currentTime = tick()
- if currentTime - lastTime >= 1 then
- local fps = frameCount / (currentTime - lastTime)
- lastTime = currentTime
- frameCount = 0
- fpsCounter.Text = fps
- if fps < 30 then
- fpsCounter.TextColor3 = Color3.new(1, 0, 0)
- elseif fps < 60 then
- fpsCounter.TextColor3 = Color3.new(0, 1, 0)
- else
- fpsCounter.TextColor3 = Color3.new(0, 1, 0)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement