game.Players.PlayerAdded:connect(function(Plyr) if Plyr:IsInGroup(3384276) or Plyr:IsInGroup(3533917) then else --How to kick? I want it so it says a message in the red box. Like, join the group to get in the game. end end)
How to kick? I want it so it says a message in the red box. Like, join the group to get in the game. What do I need to write? THIS IS A NORMAL SCRIPT
theres a method of the Player
instance that does exactly what you want it to do.
here's an example
game.Players.PlayerAdded:Connect(function(player) if not player:IsInGroup(3384276) or not player:IsInGroup(3533917) then player:Kick("Join the group to get in the game") end end)
by the way, you don't need a pointless if
if you're only going to use else
, that's why you should use not
game.Players.PlayerAdded:connect(function(plr) if plr:IsInGroup(3384276) or plr:IsInGroup(3533917) then else plr:Kick("Join the group to get into the game!") end end)
This should work^
http://wiki.roblox.com/index.php?title=API:Class/Player/Kick
local groupId = 12345678 -- Random Number local groupRankId = 15 -- Random Number game:GetService("Players").PlayerAdded:connect(function(player) if player:GetRankInGroup(groupId) <= groupRankId then player:Kick(player.Name.." is not in group.") end end)