Hey devs. I scripted myself a module that could kick anyone I don’t want in my game, but it’s don’t work.
I tried it on me to test, but nope.
Module:
local moderation = {}
local function PlrKick(plr, reason)
if not plr then
warn("Module has been paused, waiting for player... | Moderation Module Lite")
task.wait(plr)
if plr then
game:GetService("Players"):FindFirstChild(plr)
if reason ~= nil then
plr:Kick(reason)
else
plr:Kick("You have been kicked from the game, no reasons where specified.")
end
end
end
end
return moderation
Script calling the function:
local lite = require(game:GetService("ServerScriptService").ModerationModule_Lite)
local plr = game:GetService("Players")
if plr.Name == "achdef" then
lite:PlrKick("achdef", "idk")
end
local moderation = {}
local function PlrKick(plr, reason)
if not plr then
warn("Module has been paused, waiting for player... | Moderation Module Lite")
repeat until plr ~= nil
if plr then
game:GetService("Players"):FindFirstChild(plr)
if reason ~= nil then
plr:Kick(reason)
else
plr:Kick("You have been kicked from the game, no reasons where specified.")
end
end
end
end
return moderation
local moderation = {}
function moderation:PlrKick(plr, reason)
if not plr then
warn("Module has been paused, waiting for player... | Moderation Module Lite")
task.wait(plr)
if plr then
game:GetService("Players"):FindFirstChild(plr)
if reason ~= nil then
plr:Kick(reason)
else
plr:Kick("You have been kicked from the game, no reasons where specified.")
end
end
end
end
return moderation
local moderation = {}
function moderation:PlrKick(plr, reason)
if plr then
game:GetService("Players"):FindFirstChild(plr)
if reason ~= nil then
plr:Kick(reason)
else
plr:Kick("You have been kicked from the game, no reasons where specified.")
end
end
end
return moderation
CALLING SCRIPT:
local lite = require(game:GetService("ServerScriptService").ModerationModule_Lite)
local plr = game:GetService("Players")
if plr.Name == "achdef" then
lite.PlrKick("achdef", "idk")
end
local lite = require(game:GetService("ServerScriptService").ModerationModule_Lite)
local plr = game:GetService("Players")
if plr:FindFirstChild("achdef") then
lite.PlrKick("achdef", "idk")
end