[SOLVED] \n is not working in Studio

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.


Here is an example of what it looks like:


This is what it should say:

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.


littl3ni8any_alt

1 Like

This should work: "\n\nAuto moderation has detected:\n\nAutoclicker."

1 Like

Pretty sure they removed \n from kick messages. Don’t hold me hostage on that though.

2 Likes

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

1 Like

Thank you for trying to help, but it still does not work. Thanks though.

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.

Its working fine for me in Studio.

But \n does.

1 Like

try writing your string as so

local kick_message = [[You were kicked from this experience:

Auto moderation has detected:

Autoclicker.]]
player:Kick(kick_message)

I believe they have removed \n from kick messages due to an exploit or exploits.

1 Like

Oh, that’s really weird. Maybe it’s just something with my studio client?

You should do this:

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…

Hello, thank you so much for trying to help, but this doesn’t work. I think they may have removed everything like \n altogether.

1 Like

It just stopeped working for me. Using [[]] does not work also.

Ah, okay. Thank you for sacrificing, lol.

Hey, thanks for making a recommendation for the script, but this does not attempt to help with the message.

Okay, is this a ServerScript ?

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.

I think they’ve removed \n now.

Read my response, and please try to acknowledge it. :sob:

They removed this feature a while ago due to some exploits.

2 Likes

I did read it, I just didn’t respond. I aslo do agree, and think they’ve removed the feature. Thanks.