-- MM2 Role ESP + Camlock + Gun Drop ESP -- Rayfield UI | Private Test Environment Only local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))() local Players = game:GetService("Players") local RunService = game:GetService("RunService") local Workspace = game:GetService("Workspace") local UserInputService = game:GetService("UserInputService") local Camera = Workspace.CurrentCamera local LocalPlayer = Players.LocalPlayer -- State local RoleESPEnabled = false local CamlockEnabled = false local GunESPEnabled = false local FOV = 200 local Smoothness = 1 local CamlockTarget = nil local Highlights = {} local GunHighlights = {} -- Colors local Colors = { Murderer = Color3.fromRGB(255, 0, 0), Sheriff = Color3.fromRGB(0, 100, 255), Innocent = Color3.fromRGB(0, 255, 0), Gun = Color3.fromRGB(180, 0, 255) } -- Helpers local function GetRole(player) local role = nil pcall(function() -- Common MM2 paths (private test environments vary) if player.Character and player.Character:FindFirstChild("Role") then role = player.Character.Role.Value elseif player:FindFirstChild("Role") then role = player.Role.Value elseif player:GetAttribute("Role") then role = player:GetAttribute("Role") end end) return role and string.lower(tostring(role)) or nil end local function IsGunDrop(obj) if not obj or not obj:IsA("BasePart") and not obj:IsA("Model") then return false end local name = string.lower(obj.Name) return name:find("gun") or name:find("revolver") or name:find("weapon") or name:find("pistol") end local function ClearHighlights() for _, h in pairs(Highlights) do if h and h.Parent then h:Destroy() end end Highlights = {} end local function ClearGunHighlights() for _, h in pairs(GunHighlights) do if h and h.Parent then h:Destroy() end end GunHighlights = {} end local function ApplyRoleESP() ClearHighlights() if not RoleESPEnabled then return end for _, player in ipairs(Players:GetPlayers()) do if player \~= LocalPlayer and player.Character then local role = GetRole(player) local color = Colors.Innocent if role then if role:find("murder") then color = Colors.Murderer elseif role:find("sher") or role:find("police") then color = Colors.Sheriff else color = Colors.Innocent end end local char = player.Character local humanoidRoot = char:FindFirstChild("HumanoidRootPart") if humanoidRoot then local highlight = Instance.new("Highlight") highlight.Name = "RoleESP_" .. player.Name highlight.Adornee = char highlight.FillColor = color highlight.OutlineColor = color highlight.FillTransparency = 0.5 highlight.OutlineTransparency = 0 highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop highlight.Parent = char Highlights[player] = highlight end end end end local function ApplyGunESP() ClearGunHighlights() if not GunESPEnabled then return end for _, obj in ipairs(Workspace:GetDescendants()) do if IsGunDrop(obj) then -- Skip if already held by a character local parent = obj.Parent if parent and parent:IsA("Model") and parent:FindFirstChildOfClass("Humanoid") then continue end local target = obj:IsA("Model") and obj or obj if not GunHighlights[target] then local highlight = Instance.new("Highlight") highlight.Name = "GunESP" highlight.Adornee = target highlight.FillColor = Colors.Gun highlight.OutlineColor = Colors.Gun highlight.FillTransparency = 0.4 highlight.OutlineTransparency = 0 highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop highlight.Parent = target GunHighlights[target] = highlight end end end end local function GetClosestInFOV() local closest = nil local closestDist = FOV local mousePos = UserInputService:GetMouseLocation() for _, player in ipairs(Players:GetPlayers()) do if player \~= LocalPlayer and player.Character then local root = player.Character:FindFirstChild("HumanoidRootPart") local humanoid = player.Character:FindFirstChildOfClass("Humanoid") if root and humanoid and humanoid.Health > 0 then local screenPos, onScreen = Camera:WorldToViewportPoint(root.Position) if onScreen then local dist = (Vector2.new(screenPos.X, screenPos.Y) - mousePos).Magnitude if dist < closestDist then closestDist = dist closest = root end end end end end return closest end local function CamlockLoop() if not CamlockEnabled then CamlockTarget = nil return end CamlockTarget = GetClosestInFOV() if CamlockTarget then local targetPos = CamlockTarget.Position local currentCF = Camera.CFrame local goalCF = CFrame.new(currentCF.Position, targetPos) Camera.CFrame = currentCF:Lerp(goalCF, 1 / math.max(Smoothness, 0.1)) end end -- Rayfield Window local Window = Rayfield:CreateWindow({ Name = "MM2 Test | Role ESP + Camlock", LoadingTitle = "MM2 Private Test", LoadingSubtitle = "Role ESP / Camlock / Gun ESP", ConfigurationSaving = { Enabled = false }, Discord = { Enabled = false }, KeySystem = false }) local MainTab = Window:CreateTab("Main", 4483362458) local ESPTab = Window:CreateTab("ESP", 4483362458) local AimTab = Window:CreateTab("Camlock", 4483362458) -- Main MainTab:CreateToggle({ Name = "Role ESP", CurrentValue = false, Flag = "RoleESP", Callback = function(Value) RoleESPEnabled = Value if Value then ApplyRoleESP() else ClearHighlights() end end }) MainTab:CreateToggle({ Name = "Gun Drop ESP", CurrentValue = false, Flag = "GunESP", Callback = function(Value) GunESPEnabled = Value if Value then ApplyGunESP() else ClearGunHighlights() end end }) MainTab:CreateToggle({ Name = "Camlock", CurrentValue = false, Flag = "Camlock", Callback = function(Value) CamlockEnabled = Value if not Value then CamlockTarget = nil end end }) -- ESP Colors / Info ESPTab:CreateLabel("Murderer = Red Highlight") ESPTab:CreateLabel("Sheriff = Blue Highlight") ESPTab:CreateLabel("Innocent = Green Highlight") ESPTab:CreateLabel("Gun Drop = Purple Highlight") ESPTab:CreateButton({ Name = "Refresh Role ESP", Callback = function() if RoleESPEnabled then ApplyRoleESP() end end }) ESPTab:CreateButton({ Name = "Refresh Gun ESP", Callback = function() if GunESPEnabled then ApplyGunESP() end end }) -- Camlock Settings AimTab:CreateSlider({ Name = "FOV", Range = {50, 200}, Increment = 5, Suffix = "px", CurrentValue = 200, Flag = "FOV", Callback = function(Value) FOV = Value end }) AimTab:CreateSlider({ Name = "Smoothness", Range = {1, 20}, Increment = 1, Suffix = "", CurrentValue = 1, Flag = "Smooth", Callback = function(Value) Smoothness = Value end }) AimTab:CreateLabel("Smoothness 1 = Instant | Higher = Smoother") -- Loops RunService.RenderStepped:Connect(function() CamlockLoop() end) -- Periodic refresh for roles + guns (MM2 roles can change mid-round) task.spawn(function() while true do task.wait(1.5) if RoleESPEnabled then ApplyRoleESP() end if GunESPEnabled then ApplyGunESP() end end end) -- Cleanup on leave Players.PlayerRemoving:Connect(function(player) if Highlights[player] then Highlights[player]:Destroy() Highlights[player] = nil end end) Rayfield:Notify({ Title = "MM2 Test Loaded", Content = "Role ESP + Camlock + Gun ESP ready", Duration = 4, Image = 4483362458 })