Hello, when I am in Roblox Studio making a kick script for example, when I try to create a new line in the kick message using \n, it is not working. Any answers?
When a player gets kicked with an anti-autoclicker script for example, I want to create multiple lines in the kick message to keep it looking clean.
I was not unable to find anything to help me on the Roblox DevHub.
You were kicked from this experience:
Auto moderation has detected:
Autoclicker.
Here is an example of the script:
local maxClicksPS = 7
local msg = "\n Auto moderation has detected: \n \n Autoclicker. \n \nYour CPS was: \nError Getting CPS"
local player = game:GetService("Players").LocalPlayer
local UIS = game:GetService("UserInputService")
local Clicks = 0
local warns = 0
UIS.InputBegan:Connect(function(key)
if key.UserInputType == Enum.UserInputType.MouseButton1 or Enum.UserInputType.MouseButton2 or Enum.UserInputType.MouseButton3 then
Clicks += 1
end
end)
while wait(1) do
print("Clicks per Second: "..Clicks)
if Clicks >= maxClicksPS then
if warns == 0 then
warns += 1
print("AutoclickWarns: "..warns)
elseif warns == 1 then
warns += 1
print("AutoclickWarns: "..warns)
elseif warns == 2 then
warns += 1
print("AutoclickWarns: "..warns)
elseif warns == 3 then
player:Kick(msg)
warn(player.Name.." was kick for Autoclicker. CPS: "..Clicks)
end
end
Clicks = 0
end
If you are wondering, I give players warning before getting kicked incase they were not actually using an autoclicker. This warning system has nothing to do with this. (At least I think so)
If anybody is able to find any fixes to this, that would be amazing, thank you!
Thanks ChiperFunctions, AdSomnum, & Katrist for informing me that they have removed this due to exploits.
Actually /n (as far as i know) don’t work
You can try using [[]] to hold your string, maybe will fix it? I don’t think you can multi line with kicking tho
Hello, thanks for trying to help, but could you possibly provide more information on where to do this in the code? I’d like to try your solution though.
local maxClicksPS = 17
local msg = {"
Auto moderation has detected:
Autoclicker.
Your CPS was:
Error Getting CPS"}
local player = game:GetService("Players").LocalPlayer
local UIS = game:GetService("UserInputService")
local Clicks = 0
local warns = 0
UIS.InputBegan:Connect(function(key)
if key.UserInputType == Enum.UserInputType.MouseButton1 or Enum.UserInputType.MouseButton2 or Enum.UserInputType.MouseButton3 then
Clicks += 1
end
end)
while wait(1) do
print("Clicks per Second: "..Clicks)
if Clicks >= maxClicksPS then
if warns == 0 then
warns += 1
print("AutoclickWarns: "..warns)
elseif warns == 1 then
warns += 1
print("AutoclickWarns: "..warns)
elseif warns == 2 then
warns += 1
print("AutoclickWarns: "..warns)
elseif warns == 3 then
player:Kick(msg)
warn(player.Name.." was kick for Autoclicker. CPS: "..Clicks)
end
end
Clicks = 0
end
Because everyone can do 7+ clicks per second, huh ?
I don’t understand why everyone doesn’t have to do 7+ clicks a second…
I did 17 because this is where the human can click at the fastest time…
No, it was working before in StarterPlayerScripts. That is what it is still in right now. I don’t think this would have anything to do with it though, as the system is working, but just the message is messing up.