Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How can I make a script that only chooses 1 person? [Unsolved!]

Asked by 10 years ago

Like it chooses a character to be lets say killer or tagger.

2 answers

Log in to vote
0
Answered by 10 years ago

Don't repeat questions.

game.Players:GetPlayers[math.random(1, game.Players.NumPlayers)];
Ad
Log in to vote
-1
Answered by 10 years ago

I mean something like this:

function selectCharacter(person)        --XD this got a wee-bit confusing!
    local chosen = person[math.random(1,#person)]
    if string.find(tagger.Value,chosen.Name) == nil then
        if chosen:findFirstChild("ItStatus") ~= nil then
            chosen:findFirstChild("ItStatus").Value = true
        end
        if chosen:findFirstChild("leaderstats") ~= nil then
            chosen:findFirstChild("leaderstats").Value = 0
        end
        local hum = chosen.Character:findFirstChild("Humanoid")
        if hum ~= nil then
            hum.WalkSpeed = 20
        end
        local parts = chosen.Character:GetChildren()
        for i = 1,#parts do
            if parts[i].className == "Part" then
                parts[i].Anchored = false
            end
        end
        wait()
        local tagscript = chosen.Character:findFirstChild("Torso"):findFirstChild("TagFlee")
        if tagscript ~= nil then
            tagscript.Name = "Murderer"
        end
        local tagblock = chosen.Character:findFirstChild("TagBlock")
        if tagblock ~= nil then
            tagblock.Parent = nil
        end
        dubHat(chosen)
        tagger.Value = tagger.Value..", "..chosen.Name --- Change to 'Murderer Mystery Name'
    else
        selectCharacter(person)
    end
end
0
You didn't even make this mess of a script. PiggyJingles 358 — 10y

Answer this question