I'm having some problems, I tried to do a tempban but there are errors with the arguments example: if i do sb/dban/mau/hello/1 it will print hello 1 but if i do sb/dban/maumaumau/hello/1 it prints

1 i tried detecting the numbers and then subtract 2 to the charpos but when i did a longer name it didn't work i tried subtracting the charpos by 1 and it gave me

h 1 and if i did sum the charpos by 3 it would print hello 1 but still if i did a longer name it gave me

1 I need help please, i've tried a lot of things but they didn't work

if string.sub(m,1,8):lower() == ("sb/dban/")  then
	local ma = string.sub(m,9)
	local charPos = string.find(ma,"/")
	local mama = string.sub(ma,charPos+1)
local charpos = string.find(mama,"/")
local amountofdays = string.sub(mama,charpos+1)
local numposition = 0
if string.sub(mama,charpos+1,charpos+1) == "1" then
	numposition = string.find(mama,"1")
	elseif string.sub(mama,charpos+1,charpos+1) == "2" then
	numposition = string.find(mama,"2")
	elseif string.sub(mama,charpos+1,charpos+1) == "3" then
	numposition = string.find(mama,"3")
	elseif string.sub(mama,charpos+1,charpos+1) == "4" then
	numposition = string.find(mama,"4")
elseif string.sub(mama,charpos+1,charpos+1) == "5" then
	numposition = string.find(mama,"5")
elseif string.sub(mama,charpos+1,charpos+1) == "6" then
	numposition = string.find(mama,"6")
	elseif string.sub(mama,charpos+1,charpos+1) == "7" then
	numposition = string.find(mama,"7")
	elseif string.sub(mama,charpos+1,charpos+1) == "8" then
	numposition = string.find(mama,"8")
	elseif string.sub(mama,charpos+1,charpos+1) == "9" then
	numposition = string.find(mama,"9")
end
	   local name = string.sub(ma, 1, charPos-1)
            local reason = string.sub(ma, charPos + 1,charpos+3)

for i,v in pairs(game:GetService("Players"):GetPlayers()) do
	if v.Name:lower():find(name:lower()) or v.Name:lower() == name:lower() then
		print(reason)
		print(amountofdays)
		print("Work?")
	end
end

end

6 comments

0

are you trying to make a ban system that lets you specify how many days to ban?

0

Yes, but i didn't put the ban function yet , to make sure i don't ban myself more time than i expect

0

i have started answering your question below, i will finish it later sincre i have to go for now

0

You should make a ban system that unbans the player after joining your game every day for 1 whole year

0

i just finished the banning script for you, i even tested it and it works.... let me know if u need help

0

btw, sorry for messy code