local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local LocalPlayer = Players.LocalPlayer
local Camera = workspace.CurrentCamera
local Highlighted, Named = {}, {}
local Roles = {
murderer = {keys={"knife"}, fill=Color3.fromRGB(220,30,30), out=Color3.fromRGB(255,80,80)},
sheriff = {keys={"gun","sheriff"}, fill=Color3.fromRGB(30,100,220), out=Color3.fromRGB(80,160,255)},
}
local function new(class, parent, props)
local instance = Instance.new(class, parent)
for k, v in pairs(props or {}) do instance[k] = v end
return instance
end
local Gui = new("ScreenGui", LocalPlayer.PlayerGui, {ResetOnSpawn=false, IgnoreGuiInset=true})
local Murderers = new("TextLabel", Gui, {Size=UDim2.new(0,300,0,80), Position=UDim2.new(0.5,-310,1,-100), BackgroundTransparency=1, TextColor3=Color3.fromRGB(255,80,80), Font=Enum.Font.GothamBold, TextScaled=true, Text="Murderer List\n-", TextXAlignment=Enum.TextXAlignment.Left})
local Sheriffs = new("TextLabel", Gui, {Size=UDim2.new(0,300,0,80), Position=UDim2.new(0.5,10,1,-100), BackgroundTransparency=1, TextColor3=Color3.fromRGB(80,160,255), Font=Enum.Font.GothamBold, TextScaled=true, Text="Sheriff List\n-", TextXAlignment=Enum.TextXAlignment.Left})
local Dropped = Drawing.new("Line"); Dropped.Color = Color3.fromRGB(255,200,0); Dropped.Thickness = 2; Dropped.Visible = false
local function Role(player)
for role, config in pairs(Roles) do
for _, source in ipairs({player.Backpack, player.Character}) do
if source then for _, tool in ipairs(source:GetChildren()) do if tool:IsA("Tool") then for _, keyword in ipairs(config.keys) do if tool.Name:lower():find(keyword) then return role, config end end end end end
end
end
end
local function ClearHighlight(player) if Highlighted[player] then Highlighted[player]:Destroy() Highlighted[player] = nil end end
local function ClearAll(player) ClearHighlight(player) if Named[player] then Named[player]:Destroy() Named[player] = nil end end
local function Update(player)
local char = player.Character
local head = char and char:FindFirstChild("Head")
local disguiseName = char and char:GetAttribute("DisguiseName")
if not head or not disguiseName or disguiseName == "" then if Named[player] then Named[player]:Destroy() Named[player] = nil end return end
if not Named[player] or not Named[player].Parent then
local bb = new("BillboardGui", Gui, {Size=UDim2.new(0,200,0,40), StudsOffset=Vector3.new(0,3,0), AlwaysOnTop=true, Adornee=head, Enabled=true})
new("TextLabel", bb, {Name="Label", Size=UDim2.new(1,0,1,0), BackgroundTransparency=1, TextColor3=Color3.fromRGB(255,255,255), TextStrokeTransparency=0, TextStrokeColor3=Color3.fromRGB(0,0,0), Font=Enum.Font.GothamBold, TextScaled=true, ZIndex=10})
Named[player] = bb
end
Named[player].Adornee, Named[player].Enabled, Named[player].Label.Text = head, true, disguiseName
end
RunService.Heartbeat:Connect(function()
local murderers, sheriffs = {}, {}
for _, player in ipairs(Players:GetPlayers()) do
if player == LocalPlayer then continue end
Update(player)
local role, config = Role(player)
if role then
if role == "murderer" then table.insert(murderers, player.Name) end
if role == "sheriff" then table.insert(sheriffs, player.Name) end
if not (Highlighted[player] and Highlighted[player].Parent) then
ClearHighlight(player)
Highlighted[player] = new("Highlight", player.Character, {DepthMode=Enum.HighlightDepthMode.AlwaysOnTop, FillColor=config.fill, OutlineColor=config.out, FillTransparency=0.45, Adornee=player.Character})
end
else ClearHighlight(player) end
end
Murderers.Text = "Murderer List\n" .. (#murderers > 0 and table.concat(murderers, "\n") or "-")
Sheriffs.Text = "Sheriff List\n" .. (#sheriffs > 0 and table.concat(sheriffs, "\n") or "-")
local target = workspace:FindFirstChild("DroppedRevolver") and workspace.DroppedRevolver:FindFirstChild("BodyAttach")
local hrp = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
if target and hrp then
local to, onScreen = Camera:WorldToViewportPoint(target.Position)
local from = Camera:WorldToViewportPoint(hrp.Position)
Dropped.Visible = onScreen
if onScreen then Dropped.From = Vector2.new(from.X, from.Y) Dropped.To = Vector2.new(to.X, to.Y) end
else Dropped.Visible = false end
end)
Players.PlayerRemoving:Connect(ClearAll)
Players.PlayerAdded:Connect(function(player) player.CharacterRemoving:Connect(function() ClearAll(player) end) end)
for _, player in ipairs(Players:GetPlayers()) do player.CharacterRemoving:Connect(function() ClearAll(player) end) end
local function Hitbox(c) if Players:GetPlayerFromCharacter(c) == LocalPlayer then return end local h = c:WaitForChild("HumanoidRootPart") h.Size = h.Size + Vector3.new(3,0,3) h.Transparency = 1 h.CanCollide = false end
for _, p in ipairs(Players:GetPlayers()) do p.CharacterAdded:Connect(Hitbox) if p.Character then Hitbox(p.Character) end end
Players.PlayerAdded:Connect(function(p) p.CharacterAdded:Connect(Hitbox) end)
Comments
No comments yet
Be the first to share your thoughts!