Universal Script 📌
413 Views
79 Executions

Pedrinx

Universal Script 📌
Pedrodjjdj
PedrodjjdjFirst script
10 months ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

O sistema de notificações mais fluido e estável para scripts mobile. Chega de logs poluídos e mensagens repetidas. Este script foi otimizado para garantir que cada entrada e saída seja única, elegante e funcional.

View Raw
-- 🔔 NOTIFICAÇÕES AVATAR (VERSÃO FINAL ANTI-DUPLICAR)  
-- 📍 StarterPlayerScripts  

local Players = game:GetService("Players")  
local StarterGui = game:GetService("StarterGui")  
local player = Players.LocalPlayer  

-- ================= TRAVA DE SEGURANÇA (GLOBAL) =================  
if _G.NotificationSystemLoaded then
	return
end
_G.NotificationSystemLoaded = true

local activePlayers = {} -- Tabela para controlar quem já recebeu notificação
local processingQueue = {} -- Para evitar duplicação se eventos dispararem juntos

-- ================= FUNÇÃO NOTIFY =================  
local function Notify(title, text, userId)
	local iconId = "rbxthumb://type=AvatarHeadShot&id=" .. userId .. "&w=150&h=150"
	
	pcall(function()
		StarterGui:SetCore("SendNotification", {
			Title = title,
			Text = text,
			Duration = 4,
			Icon = iconId
		})
	end)
end

-- ================= FUNÇÃO PARA ADICIONAR PLAYER =================
local function AddPlayer(p)
	if p == player then return end
	if activePlayers[p.UserId] then return end -- Evita duplicação
	
	activePlayers[p.UserId] = true
	Notify("Pedrin.愛!", "Bem-vindo ☄️, " .. p.Name, p.UserId)
end

-- ================= FUNÇÃO PARA REMOVER PLAYER =================


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

More universal scripts

See all
Universal Script 📌
9.8k
60.7k
Bumped 2 minutes ago
Key System
Universal Script 📌
3.9k
10.4k
Bumped 3 minutes ago
Script hub
272.5k
884.6k
Bumped 22 minutes ago
Key System

Script hub

#16 this week

Verified script badgeAxon Hub 60+ Games & 800+ Features

Universal Script 📌
37
2
Approved 36 minutes ago
Script hub
30.2k
92.0k
Bumped 5 hours ago
Key System

Script hub

#2 this week

Verified script badgeArcane Hub | 125+ Games & 4000+ Features

Script hub
138.7k
417.6k
Bumped 5 hours ago
Key System

Script hub

Hall of Fame #6

Verified script badgeAcro Hub | Easy Key System