What this is supposed to be for is for banned players, kicked players, etc. So far, I've created this function:
local Banned = {} function isPlayerBanned(BanChk) for i, v in pairs(Banned) do if Banned == v then return true end end end game.Players.PlayerAdded:connect(function(newplayer) if playerBanned(newplayer.Name) then
The problem I get after the 12th line is that I don't know how to shutdown a player. Not remove their character so they can't spawn or interact with anything, but genuinely make the "game shutdown" message pop up for them so that all instances have stopped for them. Any help?
There is actually an easy way to disconnect the players client!
All you need to do is use the function Kick()
Here is some information in the ROBLOX wiki, provided in this link
If this helps, Up-vote and accept!
This should help: http://wiki.roblox.com/index.php?title=API:Class/Player/Kick
Disconnects their client so it would essentially shutdown the game for them. The final product would be:
local banned = {} function isPlayerBanned(player) for int, val in pairs(banned) do if val == banned then return true else return false end end end game.Players.PlayerAdded:connect(function(player) if isPlayerBanned(player) then player:Kick() end end)
local Banned = {}
function isPlayerBanned(BanChk) for i, v in pairs(Banned) do if Banned == v then return true end end end
game.Players.PlayerAdded:connect(function(newplayer) if playerBanned(newplayer.Name) then newplayer:Kick("Banned") end end)