I’m not sure why, but it won’t make a new line on the kick message, I don’t know if I have to do something else or if it doesn’t work in kick messages. Can somebody please help me with this?
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local Folder = script.Parent
function onPlayerAdded(player)
if not RunService:IsStudio() then
for i,v in pairs(Folder:GetChildren()) do
if v:IsA("NumberValue") then
if player.UserId == v.Value then
player:Kick("You are currently banned from The game.\n\nReason: " .. v.Reason.Value .. "\n\n" .. v.Time.Value)
end
end
end
end
end
Players.PlayerAdded:Connect(onPlayerAdded)
for _, player in pairs(Players:GetPlayers()) do
onPlayerAdded(player)
end
Try using [[]] instead if "" because unlike using the second one, using the first will give you the ability to make strings with breaks without using \n
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local Folder = script.Parent
function onPlayerAdded(player)
if not RunService:IsStudio() then
for i, v in ipairs(Folder:GetChildren()) do
if v:IsA("NumberValue") then
if player.UserId == v.Value then
player:Kick([[You are currently banned from The game.
Reason: ]] .. v.Reason.Value .. [[
]] .. v.Time.Value)
end
end
end
end
end
Players.PlayerAdded:Connect(onPlayerAdded)
for _, player in ipairs(Players:GetPlayers()) do
onPlayerAdded(player)
end