Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

2 answers

Don't repeat questions.

game.Players:GetPlayers[math.random(1, game.Players.NumPlayers)];

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

1 comment

0

You didn't even make this mess of a script.

This discussion is preserved as it was. New answers, comments, and votes are closed.