hi so I had a warning command made for me a while ago but the guy never made it so that it captures the full reason
for example if you wrote ‘:warn [player] trolling and admin abuse’ then the warning reason would only be ‘trolling’
can anyone modify it so that it works how it’s supposed to?
Here is my code:
local ChatFunctions = {
["warn"] = function(Words,Player)
for _,Target in pairs(game.Players:GetPlayers()) do
if string.find(string.lower(Target.Name),string.lower(Words[2])) then
if Words[3] then
local WarnFolder = game.Workspace:WaitForChild("WarnedPlayers")
local PlayerWarning = Instance.new("StringValue", WarnFolder)
PlayerWarning.Value = Words[3]
Target:WaitForChild("Warnings").Value = Target:WaitForChild("Warnings").Value + 1
PlayerWarning.Name = Target.Name..tostring(Target:WaitForChild("Warnings").Value)
end
end
wait()
end
end,
}