Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Notification + Console Script with Crash Detection
- -- Works for most Roblox executors
- local StarterGui = game:GetService("StarterGui")
- local RunService = game:GetService("RunService")
- -- Function to send a notification to the player
- local function SendNotification(title, text, duration)
- StarterGui:SetCore("SendNotification", {
- Title = title,
- Text = text,
- Duration = duration or 5
- })
- end
- -- On-Screen Notification: Look at the console
- SendNotification("Notification", "Look at the console. Type /console in chat to open the console.", 10)
- -- Print Message to Console
- print("There no problem :)")
- -- Lag and Crash Detection
- local lastFrameTime = tick() -- Time of last frame render
- local crashThreshold = 2 -- Threshold for extreme lag/crash detection in seconds
- RunService.RenderStepped:Connect(function()
- local currentFrameTime = tick()
- local delta = currentFrameTime - lastFrameTime -- Time between frames
- lastFrameTime = currentFrameTime
- -- Lag Warning (over 0.5 seconds of delay)
- if delta > 0.5 and delta < crashThreshold then
- warn("You are lagging⚠️")
- end
- -- Crash Warning (extreme delay)
- if delta >= crashThreshold then
- error("You are about to crash☢️")
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement