Spy finder
Key Required

Spy finder

Who's the Spy?progamermstprogamermst 20K views 71 executesUpdated May 25, 2024
5.0/ 5(5 votes)
50100% Positive
Lua Script•58 lines (1856 chars)
local Players = game:GetService("Players")

local function createLabel(character, text, textColor)
    local billboardGui = Instance.new("BillboardGui")
    billboardGui.Name = "StatusLabel"
    billboardGui.Adornee = character:FindFirstChild("Head")
    billboardGui.Size = UDim2.new(0, 100, 0, 50)
    billboardGui.StudsOffset = Vector3.new(0, 2, 0)
    billboardGui.AlwaysOnTop = true

    local textLabel = Instance.new("TextLabel")
    textLabel.Size = UDim2.new(1, 0, 1, 0)
    textLabel.BackgroundTransparency = 1
    textLabel.Text = text
    textLabel.TextColor3 = textColor
    textLabel.TextScaled = true
    textLabel.Font = Enum.Font.SourceSansBold
    textLabel.Parent = billboardGui

    billboardGui.Parent = character
end

local function checkPlayerForStatus(player)
    local boolFolder = player:FindFirstChild("boolFolder")
    if boolFolder then
        local isSpy = boolFolder:FindFirstChild("isSpy")
        if isSpy and isSpy:IsA("BoolValue") then
            if player.Character and player.Character:FindFirstChild("Head") then
                local existingLabel = player.Character:FindFirstChild("StatusLabel")
                if existingLabel then
                    existingLabel:Destroy()
                end
                if isSpy.Value then
                    createLabel(player.Character, "Spy", Color3.new(1, 0, 0))
                else
                    createLabel(player.Character, "Innocent", Color3.new(0, 1, 0))
                end
            end
        end
    end
end

local function checkAllPlayers()
    for _, player in pairs(Players:GetPlayers()) do
        checkPlayerForStatus(player)
    end
end

Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        checkPlayerForStatus(player)
    end)
end)

while true do
    checkAllPlayers()
    wait(2)
end

Features & Information

Writes spy/innocent above the player heads

Community Comments (4)

TedyTedyMay 25, 2024(edited)

@progamermst can u do a script for little world pls

skip_1stskip_1stMay 25, 2024(edited)

how to work doesn't work pls tell how

SkireScriptsSkireScriptsMay 27, 2024(edited)

looks like its made by chat gpt lol

KuroyamiKuroyamiJun 3, 2024(edited)

It working bro, but I need an script to know the word innocent get so I can win by guess the word please bro if you can make it, I appreciate it

More Scripts for Who's the Spy?