Advertisement
ILovePotato

Untitled

Dec 17th, 2024
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. -- Lag Detection Notification Script
  2. -- Works for most Roblox executors
  3.  
  4. local StarterGui = game:GetService("StarterGui")
  5. local RunService = game:GetService("RunService")
  6.  
  7. -- Function to send a clean notification
  8. local function ShowNotification(title, message, duration)
  9. StarterGui:SetCore("SendNotification", {
  10. Title = title, -- Notification title
  11. Text = message, -- Notification message
  12. Duration = duration or 5 -- Duration in seconds
  13. })
  14. end
  15.  
  16. -- Initial Notification: Start Monitoring
  17. ShowNotification("Result", "Monitoring Lag Status...", 5)
  18.  
  19. -- Lag Detection Variables
  20. local lastFrameTime = tick()
  21. local crashThreshold = 2 -- Time in seconds for "YOU ARE ABOUT TO CRASH"
  22. local nearCrashThreshold = 3 -- Time in seconds for "NEAR OF CRASH"
  23.  
  24. RunService.RenderStepped:Connect(function()
  25. local currentFrameTime = tick()
  26. local delta = currentFrameTime - lastFrameTime
  27. lastFrameTime = currentFrameTime
  28.  
  29. -- Conditions for Lag States
  30. if delta < 0.5 then
  31. -- No Lag
  32. ShowNotification("Result", "There No Lag This Time", 3)
  33. elseif delta >= 0.5 and delta < crashThreshold then
  34. -- Lag Detected
  35. ShowNotification("Result", "Warning You Are Lagging⚠️", 4)
  36. elseif delta >= crashThreshold and delta < nearCrashThreshold then
  37. -- Extreme Lag Detected
  38. ShowNotification("RESULT☢️", "YOU ARE ABOUT TO CRASH☢️☢️☢️", 5)
  39. elseif delta >= nearCrashThreshold then
  40. -- Near Crash Detected
  41. ShowNotification("☣️", "NEAR OF CRASH☢️☣️", 6)
  42. end
  43. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement