Hello! Basically, I’m trying to make a script, once you type /jail then, apart from the first 5 words, /jail it should detect plr name, but how would I make like, it just doesn’t detect the 10 letter something like >= 10 ? anybody can help? SCRIPT
game.Players.PlayerAdded:Connect(function(plr)
game.ReplicatedStorage.Events.Notifcation:FireAllClients("Player Connected", plr.Name.." Joined", 7)
plr.Chatted:Connect(function(chat)
if plr:GetRankInGroup(5221664) >= 252 then
if string.lower(string.sub(chat, 1, 7)) == "/unjail" then
local letter1 = string.sub(chat, 10)
game.Players:FindFirstChild(letter1):WaitForChild("Status")["Prison Time"].Value = 0
elseif string.lower(string.sub(chat, 1, 5)) == "/jail" then
local letter1 = string.sub(chat, 10)
game.Players:FindFirstChild(letter1):WaitForChild("Status")["Prison Time"].Value = 300
end
end
end)
end)
If you’re going to use string.split() instead of string.sub() then you can skip the first value in the returned array as, at that point, string.sub() is not nessecary