Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I can't make permanent banning functions and I don't know if I've used string.match() correctly?

Asked by 5 years ago
Edited 5 years ago

This question has been solved by the original poster.

Hello, I'm making an anti-scam bot script that should ban scam bots but I don't know how to, the only function that I know of is player:Kick() but no player:Ban(). Any help towards the code to make it more hybrid, advice, etc would be greatly appreciated.

local function botChecker()

local player = game.Players.LocalPlayer

game.Players.PlayerAdded:Connect(function(plr)

local name = plr.Name

local scamWebsitesTable = {

'fastbucks.me'

-- Feel free to add more scam websites

}

game.Players.LocalPlayer.Chatted:Connect(function(msg)

if string.sub(msg, 1, 150) == '/me just got TONS of ROBUX using '..scamWebsitesTable..'!'..'Visit '..scamWebsitesTable..' in your browser to generate robux instantly!' then

string.match('[/me just got TONS of ROBUX using! Visit* '..scamWebsitesTable..' [in your browser to generate robux instantly!*', scamWebsitesTable and '[Visit*' and '[/me*' and '[ROBUX*' and '[robux*')

local BannedPlayerId = player.UserId

local BanReason = 'Dont break the games rules. Please read Robloxs ToS if you are unsure on the rules.'

local enforceBan = true

local Banner = 'The smart game, otherwise Cinema_Sin.'

game.Players.PlayerAdded:Connect(function(instance)

if instance.UserId == BannedPlayerId then

instance:Kick('You got banned by '..Banner..' Reason: '..BanReason)

end

end)

end

end)

end)

end)
0
I found out how to do It thanks! Cinema_Sin -3 — 5y
0
put [Solved] in the title mattchew1010 396 — 5y
0
Put solved in the title Oskar2266001 3 — 5y

Answer this question