I am making a GUI with a group checker code thing I did, so when the player is "NOT" in the group then it will perform a 10 second countdown with a info text on it. When it reaches 0 it is supposed to use the function :Kick(). The only problem is I am not asking a name of the person to kick them I am simply asking whoever is not in the group after 10 seconds, kick them. How would you do that?
For the people who want a script :
Button = script.Parent -- Note this is not a button. This is a TextLabel(Don't ask why it is named button)
Menu = script.Parent.Parent -- Ignore the 2 buttons as it is for something else on the GUI.
Menu2 = script.Parent.Parent.Parent
wait(1)
--This is not in a Local Script as all it does is remove the player rather than disconnecting them(I DO NOT WANT THEM TO CRASH!!!)
if script.Parent.Parent.Parent.Group.Value == false then
Menu.Visible = true
wait(1)
Button.Text = ("Force Kick In - 9")
wait(1)
Button.Text = ("Force Kick In - 8")
wait(1)
Button.Text = ("Force Kick In - 7")
wait(1)
Button.Text = ("Force Kick In - 6")
wait(1)
Button.Text = ("Force Kick In - 5")
wait(1)
Button.Text = ("Force Kick In - 4")
wait(1)
Button.Text = ("Force Kick In - 3")
wait(1)
Button.Text = ("Force Kick In - 2")
wait(1)
Button.Text = ("Force Kick In - 1")
wait(1)
Button.Text = ("Force Kick In - 0")
game.Players:connect(function(Player) -- Like how does this work ????
Player:Kick()
end)
end

4 comments
Not straight away. In other words. When they join, the script counts to 10 and then kicks them. I have the group thing sorted I was just wondering how the function :Kick() would work.
The kick function will only work on the server and you need to kick the game player. e.g game.Players.[player name]:Kick()
However I would like to kick the player "WITHOUT" defying a player name.
This script will only kick a player if they are not part of the group. As soon as the player is part of the group and they join the server then they will not be kicked, it does not kick a player depending upon their name. Also I have added the script in the edit