1local Players = game:GetService("Players")2local RunService = game:GetService("RunService")3local LocalPlayer = Players.LocalPlayer4local Camera = workspace.CurrentCamera5local Highlighted, Named = {}, {}6local Roles = {7 murderer = {keys={"knife"}, fill=Color3.fromRGB(220,30,30), out=Color3.fromRGB(255,80,80)},8 sheriff = {keys={"gun","sheriff"}, fill=Color3.fromRGB(30,100,220), out=Color3.fromRGB(80,160,255)},9}10local function new(class, parent, props)11 local instance = Instance.new(class, parent)12 for k, v in pairs(props or {}) do instance[k] = v end13 return instance14end15local Gui = new("ScreenGui", LocalPlayer.PlayerGui, {ResetOnSpawn=false, IgnoreGuiInset=true})16local 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 Listn-", TextXAlignment=Enum.TextXAlignment.Left})17local 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 Listn-", TextXAlignment=Enum.TextXAlignment.Left})18local Dropped = Drawing.new("Line"); Dropped.Color = Color3.fromRGB(255,200,0); Dropped.Thickness = 2; Dropped.Visible = false19local function Role(player)20 for role, config in pairs(Roles) do21 for _, source in ipairs({player.Backpack, player.Character}) do22 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 end23 end24 end25end26local function ClearHighlight(player) if Highlighted[player] then Highlighted[player]:Destroy() Highlighted[player] = nil end end27local function ClearAll(player) ClearHighlight(player) if Named[player] then Named[player]:Destroy() Named[player] = nil end end28local function Update(player)29 local char = player.Character30 local head = char and char:FindFirstChild("Head")31 local disguiseName = char and char:GetAttribute("DisguiseName")32 if not head or not disguiseName or disguiseName == "" then if Named[player] then Named[player]:Destroy() Named[player] = nil end return end33 if not Named[player] or not Named[player].Parent then34 local bb = new("BillboardGui", Gui, {Size=UDim2.new(0,200,0,40), StudsOffset=Vector3.new(0,3,0), AlwaysOnTop=true, Adornee=head, Enabled=true})35 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})36 Named[player] = bb37 end38 Named[player].Adornee, Named[player].Enabled, Named[player].Label.Text = head, true, disguiseName39end40RunService.Heartbeat:Connect(function()41 local murderers, sheriffs = {}, {}42 for _, player in ipairs(Players:GetPlayers()) do43 if player == LocalPlayer then continue end44 Update(player)45 local role, config = Role(player)46 if role then47 if role == "murderer" then table.insert(murderers, player.Name) end48 if role == "sheriff" then table.insert(sheriffs, player.Name) end49 if not (Highlighted[player] and Highlighted[player].Parent) then50 ClearHighlight(player)51 Highlighted[player] = new("Highlight", player.Character, {DepthMode=Enum.HighlightDepthMode.AlwaysOnTop, FillColor=config.fill, OutlineColor=config.out, FillTransparency=0.45, Adornee=player.Character})52 end53 else ClearHighlight(player) end54 end55 Murderers.Text = "Murderer Listn" .. (#murderers > 0 and table.concat(murderers, "n") or "-")56 Sheriffs.Text = "Sheriff Listn" .. (#sheriffs > 0 and table.concat(sheriffs, "n") or "-")57 local target = workspace:FindFirstChild("DroppedRevolver") and workspace.DroppedRevolver:FindFirstChild("BodyAttach")58 local hrp = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart")59 if target and hrp then60 local to, onScreen = Camera:WorldToViewportPoint(target.Position)61 local from = Camera:WorldToViewportPoint(hrp.Position)62 Dropped.Visible = onScreen63 if onScreen then Dropped.From = Vector2.new(from.X, from.Y) Dropped.To = Vector2.new(to.X, to.Y) end64 else Dropped.Visible = false end65end)66Players.PlayerRemoving:Connect(ClearAll)67Players.PlayerAdded:Connect(function(player) player.CharacterRemoving:Connect(function() ClearAll(player) end) end)68for _, player in ipairs(Players:GetPlayers()) do player.CharacterRemoving:Connect(function() ClearAll(player) end) end69local 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 end70for _, p in ipairs(Players:GetPlayers()) do p.CharacterAdded:Connect(Hitbox) if p.Character then Hitbox(p.Character) end end71Players.PlayerAdded:Connect(function(p) p.CharacterAdded:Connect(Hitbox) end)
Comments · …
Loading comments…