
413 Views
79 Executions
Pedrinx
Universal Script 📌
PedrodjjdjFirst script
10 months ago
Please login to perform these actions:Does it work?
No reports yetNo 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.
-- 🔔 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
0Log in to join the conversation. Login
No comments yet. Be the first!







