Universal Script 📌
424 Views
154 Executions

Pedrinx

Universal Script 📌
Pedrodjjdj
PedrodjjdjFirst script
11 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
Script hub
14
1
Approved 5 minutes ago
Script hub
20
1
Approved 17 minutes ago

Script hub

orcle

Universal Script 📌
51
13
Approved 38 minutes ago
Script hub
64
4
Approved 1 hour ago
Universal Script 📌
70
9
Approved 1 hour ago
Script hub
53
3
Approved 1 hour ago
Key System