
Key RequiredUniversal

-- =================================
-- DEV -- > R-77 ; DISCORD - tankuct.
-- =================================
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local TextChatService = game:GetService("TextChatService")
local TweenService = game:GetService("TweenService")
local isMobile = UserInputService.TouchEnabled and not UserInputService.KeyboardEnabled
local roleColors = {
["Mafia"] = Color3.fromRGB(255, 70, 70),
["Detective"] = Color3.fromRGB(70, 120, 255),
["Doctor"] = Color3.fromRGB(80, 255, 120),
["Citizen"] = Color3.fromRGB(200, 200, 200),
["Sheriff"] = Color3.fromRGB(255, 180, 60),
["Jester"] = Color3.fromRGB(255, 100, 255),
["Mayor"] = Color3.fromRGB(255, 220, 90),
}
local defaultColor = Color3.fromRGB(150,150,150)
local espHighlights = {}
local isMinimized = false
local GUI = Instance.new("ScreenGui", game.CoreGui)
GUI.Name = "MafiaMoonUI"
GUI.ResetOnSpawn = false
local mainWidth = isMobile and 280 or 330
local mainHeight = isMobile and 420 or 480
local Main = Instance.new("Frame", GUI)
Main.Size = UDim2.new(0, mainWidth, 0, mainHeight)
Main.Position = isMobile and UDim2.new(0.5, -mainWidth/2, 0, 20) or UDim2.new(0, 30, 0, 40)
Main.BackgroundColor3 = Color3.fromRGB(18,18,18)
Main.BorderSizePixel = 0
Instance.new("UICorner", Main).CornerRadius = UDim.new(0, 12)
local shadow = Instance.new("ImageLabel", Main)
shadow.Image = "rbxassetid://1316045217"
shadow.Size = UDim2.new(1, 40, 1, 40)
shadow.Position = UDim2.new(0, -20, 0, -20)
shadow.BackgroundTransparency = 1
shadow.ImageColor3 = Color3.fromRGB(0,0,0)
shadow.ImageTransparency = 0.55
shadow.ZIndex = -1
local Topbar = Instance.new("Frame", Main)
Topbar.Size = UDim2.new(1, 0, 0, 40)
Topbar.BackgroundColor3 = Color3.fromRGB(25,25,25)
Instance.new("UICorner", Topbar).CornerRadius = UDim.new(0, 12)
local Title = Instance.new("TextLabel", Topbar)
Title.Text = "🎭 Player Roles"
Title.Size = isMobile and UDim2.new(1, -80, 1, 0) or UDim2.new(1, -160, 1, 0)
Title.Position = UDim2.new(0, 10, 0, 0)
Title.BackgroundTransparency = 1
Title.TextColor3 = Color3.fromRGB(255,255,255)
Title.Font = Enum.Font.GothamBold
Title.TextSize = isMobile and 15 or 18
Title.TextXAlignment = Enum.TextXAlignment.Left
local MinimizeBtn = Instance.new("TextButton", Topbar)
MinimizeBtn.AnchorPoint = Vector2.new(1, 0.5)
MinimizeBtn.Position = UDim2.new(1, -10, 0.5, 0)
MinimizeBtn.Size = UDim2.new(0, 30, 0, 30)
MinimizeBtn.BackgroundColor3 = Color3.fromRGB(35,35,35)
MinimizeBtn.Text = "−"
MinimizeBtn.TextColor3 = Color3.fromRGB(255,255,255)
MinimizeBtn.Font = Enum.Font.GothamBold
MinimizeBtn.TextSize = 20
Instance.new("UICorner", MinimizeBtn).CornerRadius = UDim.new(0, 6)
local Credit = Instance.new("TextLabel", Topbar)
Credit.AnchorPoint = Vector2.new(1, 0.5)
Credit.Position = UDim2.new(1, -45, 0.5, 0)
Credit.Size = UDim2.new(0, 100, 1, 0)
Credit.BackgroundTransparency = 1
Credit.Text = isMobile and "R-77" or "Made with ❤️ by R-77"
Credit.Font = Enum.Font.Gotham
Credit.TextSize = isMobile and 10 or 11
Credit.TextColor3 = Color3.fromRGB(160,160,160)
Credit.TextXAlignment = Enum.TextXAlignment.Right
Credit.Visible = not isMobile or false
local line = Instance.new("Frame", Main)
line.Size = UDim2.new(1, -20, 0, 1)
line.Position = UDim2.new(0, 10, 0, 45)
line.BackgroundColor3 = Color3.fromRGB(60,60,60)
local Content = Instance.new("Frame", Main)
Content.Name = "Content"
Content.Size = UDim2.new(1, 0, 1, -40)
Content.Position = UDim2.new(0, 0, 0, 40)
Content.BackgroundTransparency = 1
Content.ClipsDescendants = true
local Buttons = Instance.new("Frame", Content)
Buttons.Size = UDim2.new(1, -20, 0, isMobile and 75 or 80)
Buttons.Position = UDim2.new(0, 10, 0, 15)
Buttons.BackgroundTransparency = 1
local function createButton(text)
local btn = Instance.new("TextButton")
btn.Size = UDim2.new(1, 0, 0, isMobile and 32 or 35)
btn.BackgroundColor3 = Color3.fromRGB(30,30,30)
btn.TextColor3 = Color3.fromRGB(255,255,255)
btn.Text = text
btn.Font = Enum.Font.GothamBold
btn.TextSize = isMobile and 12 or 14
Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 6)
return btn
end
local RandomBtn = createButton("🔮 Reveal Random")
RandomBtn.Parent = Buttons
local AllBtn = createButton("🌙 Reveal All")
AllBtn.Position = UDim2.new(0, 0, 0, isMobile and 38 or 40)
AllBtn.Parent = Buttons
local List = Instance.new("ScrollingFrame", Content)
List.Size = UDim2.new(1, -20, 1, isMobile and -105 or -110)
List.Position = UDim2.new(0, 10, 0, isMobile and 95 or 100)
List.BackgroundTransparency = 1
List.CanvasSize = UDim2.new(0, 0, 0, 0)
List.ScrollBarThickness = isMobile and 3 or 4
List.ScrollBarImageColor3 = Color3.fromRGB(120,120,120)
local Layout = Instance.new("UIListLayout", List)
Layout.Padding = UDim.new(0, isMobile and 4 or 5)
Layout.SortOrder = Enum.SortOrder.LayoutOrder
--=============== MINIMIZE ===============--
local function toggleMinimize()
isMinimized = not isMinimized
local targetSize = isMinimized and UDim2.new(0, mainWidth, 0, 40) or UDim2.new(0, mainWidth, 0, mainHeight)
local tweenInfo = TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
local tween = TweenService:Create(Main, tweenInfo, {Size = targetSize})
MinimizeBtn.Text = isMinimized and "+" or "−"
tween:Play()
end
MinimizeBtn.MouseButton1Click:Connect(toggleMinimize)
--=============== DRAG ===============--
local dragging, dragStart, startPos
local function onDragStart(input)
dragging = true
dragStart = input.Position
startPos = Main.Position
end
local function onDragMove(input)
if dragging then
local delta = input.Position - dragStart
Main.Position = UDim2.new(
startPos.X.Scale, startPos.X.Offset + delta.X,
startPos.Y.Scale, startPos.Y.Offset + delta.Y
)
end
end
local function onDragEnd()
dragging = false
end
Topbar.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
onDragStart(input)
end
end)
UserInputService.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
onDragMove(input)
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
onDragEnd()
end
end)
--=============== ESP ===============--
local function updateESP(player)
if not player.Character then return end
local role = player:GetAttribute("Role")
if not role then
if espHighlights[player] then espHighlights[player]:Destroy() espHighlights[player]=nil end
return
end
local color = roleColors[role] or defaultColor
if not espHighlights[player] then
local h = Instance.new("Highlight")
h.FillTransparency = 0.75
h.OutlineTransparency = 0
h.FillColor = color
h.OutlineColor = color
h.Adornee = player.Character
h.Parent = player.Character
espHighlights[player] = h
else
local h = espHighlights[player]
h.FillColor = color
h.OutlineColor = color
h.Adornee = player.Character
end
end
local function removeESP(player)
if espHighlights[player] then
espHighlights[player]:Destroy()
espHighlights[player] = nil
end
end
--=============== CHAT SEND ===============--
local function sendChat(message)
local ch = TextChatService.TextChannels.RBXGeneral
if ch then
ch:SendAsync(message)
end
end
--=============== UPDATE LIST ===============--
local function updateRoles()
for _, obj in ipairs(List:GetChildren()) do
if obj:IsA("Frame") then obj:Destroy() end
end
local count = 0
for _, plr in ipairs(Players:GetPlayers()) do
local role = plr:GetAttribute("Role")
if role then
count += 1
local item = Instance.new("Frame", List)
item.Size = UDim2.new(1, 0, 0, isMobile and 36 or 32)
item.BackgroundColor3 = Color3.fromRGB(28,28,28)
Instance.new("UICorner", item).CornerRadius = UDim.new(0, 8)
local lbl = Instance.new("TextLabel", item)
lbl.Size = UDim2.new(1, isMobile and -75 or -90, 1, 0)
lbl.Position = UDim2.new(0, 6, 0, 0)
lbl.BackgroundTransparency = 1
lbl.Font = Enum.Font.Gotham
lbl.TextXAlignment = Enum.TextXAlignment.Left
lbl.TextColor3 = Color3.fromRGB(230,230,230)
lbl.TextSize = isMobile and 12 or 14
lbl.TextTruncate = Enum.TextTruncate.AtEnd
lbl.Text = plr.DisplayName .. " - " .. role
local revealBtn = Instance.new("TextButton", item)
revealBtn.Size = isMobile and UDim2.new(0, 65, 1, -6) or UDim2.new(0, 80, 1, -6)
revealBtn.Position = isMobile and UDim2.new(1, -68, 0, 3) or UDim2.new(1, -83, 0, 3)
revealBtn.AnchorPoint = Vector2.new(0, 0)
revealBtn.BackgroundColor3 = Color3.fromRGB(40,40,40)
revealBtn.TextColor3 = Color3.fromRGB(255,255,255)
revealBtn.Font = Enum.Font.GothamBold
revealBtn.TextSize = isMobile and 10 or 12
revealBtn.Text = isMobile and "🔮" or "🔮 Reveal"
Instance.new("UICorner", revealBtn).CornerRadius = UDim.new(0, 6)
revealBtn.MouseButton1Click:Connect(function()
local role = plr:GetAttribute("Role") or "Unknown"
sendChat("Random Tarot Cards have revealed " .. plr.DisplayName .. "'s role: " .. role)
end)
updateESP(plr)
end
end
List.CanvasSize = UDim2.new(0,0,0, Layout.AbsoluteContentSize.Y + 10)
Title.Text = "🎭 Roles (" .. count .. ")"
end
--=============== TAROT BUTTONS ==================--
RandomBtn.MouseButton1Click:Connect(function()
local players = Players:GetPlayers()
if #players == 0 then return end
local target = players[math.random(1, #players)]
local role = target:GetAttribute("Role") or "Unknown"
sendChat("Random Tarot Cards have revealed " .. target.DisplayName .. "'s role: " .. role)
end)
AllBtn.MouseButton1Click:Connect(function()
sendChat("=========== Tarot Cards Reveal ===========")
for _, PLAYER in pairs(Players:GetPlayers()) do
local role = PLAYER:GetAttribute("Role")
if role then
sendChat(PLAYER.DisplayName .. "'s Role: " .. role)
task.wait(0.4)
end
end
sendChat("=========================================")
end)
--=============== EVENTS ===============--
Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function()
updateESP(plr)
end)
updateRoles()
end)
Players.PlayerRemoving:Connect(function(plr)
removeESP(plr)
updateRoles()
end)
task.spawn(function()
while true do
task.wait(1)
updateRoles()
end
end)
task.spawn(function()
while true do
task.wait(0.5)
for _, plr in ipairs(Players:GetPlayers()) do
updateESP(plr)
end
end
end)
updateRoles()
-- =================================
-- DEV -- > R-77 ; DISCORD - tankuct.
-- =================================



It works i check it
Doesn't work anymore