local re = game.ReplicatedStorage.RemoteEvents
local values = game.ReplicatedStorage.Values
local nl = 1
local function randomP()
local players = game.Workspace.PlayerTest:GetChildren()
local PlayerNum = math.random(1, #players)
local ChosenPlayer = players[PlayerNum]
print(ChosenPlayer)
values.CanStart.Value = true
values.NextUp.Value = ChosenPlayer.Name
values.NextName.Value = ChosenPlayer.Name
end
local function clear()
values.Value.Value = true
values.PlayerValue.Value = ""
values.NValue.Value = 0
values.YValue.Value = 0
values.NameValue.Value = ""
values.CanStart.Value = false
end
repeat
re.TimerEvent:FireAllClients(false, values.NextUp.Value, 0, "", values.Players.Value)
wait()
until values.Players.Value >= 2
wait(10)
local function G()
print("Okay")
values.Value.Value = false
values.PlayerValue.Value = values.NextUp.Value
values.NameValue.Value = values.NextName.Value
game.Workspace.Helicopter.Main.SurfaceGui1.Back.Text = "Decide "..values.NextUp.Value.."'s fate!"
game.Workspace.Helicopter.Main.SurfaceGui.Front.Text = "Decide "..values.NextUp.Value.."'s fate!"
if values.NameValue.Value ~= "" then
--game.Players:FindFirstChild(values.NextName.Value).Character:FindFirstChild("HumanoidRootPart").CFrame = game.Workspace.TPart.CFrame
end
randomP()
re.TimerEvent:FireAllClients(true, values.NextUp.Value, 30, "Next Up:")
re.VoteEvent:FireAllClients(values.PlayerValue.Value)
wait(30)
if values.NValue.Value > values.YValue.Value then
if values.NameValue.Value ~= "" then
if game.Players:FindFirstChild(values.NameValue.Value).HasAvoid.Value == false then
--game.Players:FindFirstChild(values.NameValue.Value):Kick("Kicked by majority")
re.CloseEvent:FireAllClients(values.PlayerValue.Value, "Kick")
else
game.Players:FindFirstChild(values.NameValue.Value).HasAvoid.Value = false
re.BuyEvent:FireClient(game.Players:FindFirstChild(values.NameValue.Value), "not")
--game.Workspace:FindFirstChild(values.NameValue.Value).HumanoidRootPart.Position = game.Workspace.SpawnLocation.Position
end
end
end
if values.NValue.Value <= values.YValue.Value then
if values.NameValue.Value ~= "" then
re.CloseEvent:FireAllClients(values.PlayerValue.Value, "Stay")
--game.Workspace:FindFirstChild(values.NameValue.Value).HumanoidRootPart.Position = game.Workspace.SpawnLocation.Position
end
end
wait(3)
clear()
end
while true do
if values.Value.Value == true then
G()
end
end
Right now since I dont have many people to help test I have 3 parts to fill in as the players

1 comment
I think that's possible cause most of the game doesn't use this method, it's just based of the players luckiness but my answer is use for I loop to check if the chosen player just got picked before