How do i kick players like if they step on a brick lets say they step on a brick is there a way to get the players without writing it down?
Game.Players.(PlayerName):Kick("Sorry You've Been Kicked")
How do i kick players like if they step on a brick lets say they step on a brick is there a way to get the players without writing it down?
Game.Players.(PlayerName):Kick("Sorry You've Been Kicked")
For first, the Game is deprecated use game
You need to get all players with for
You can see here: Roblox Wiki - for
Example:
local table = {"Apple","Orange"}
for i,v in pairs(table) do
print(v)
end
You can simple use:
for i,v in pairs(game.Players:GetPlayers()) do
v:Kick("Sorry You've Been Kicked!")
end
Hope it helped!
That's not called "pairs", it's a generic for loop. Please use the correct terminology if you will answer a question.
Thank you. I did not know much about how to explain this up because I forgot to put on the for and the pairs had nothing to do with. I just knew how to use.
Don't need parentheses around "loop".
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
You are sending some mixed messages here, do you want to kick everyone or just the person who touched the part?