I have a gear script and the script works fine but it doesn't know when to stop recording the text so for example if I said
"a 130113146" how would I fix this problem in scripting.
Heres my script
function Getnumber(player,text,message) local players = game.Players:GetChildren() local numbers = {"1","2","3","4","5","6","7","8","9"} local command = string.gsub(string.lower(message),text,"") local remove1 = string.gsub(string.lower(message),command,"") local name = string.gsub(remove1,n,"") if string.sub(text,1,2) == "me" then return 2 end if string.sub(text,1,3) == "all" then return 3 end if string.sub(text,1,6) == "others" then return 6 end if string.sub(text,1,9) == "nonadmins" then return 9 end if string.sub(text,1,6) == "admins" then return 6 end for i,v in pairs(players) do local strlower = string.lower(v.Name) local sub = string.sub(strlower,1,2) return #sub end print(name) return nil end game.Players.PlayerAdded:Connect(function(player) player.Chatted:Connect(function(chatted) if string.sub(chatted,1,4) == "gear" then local number = Getnumber(player,string.lower(string.sub(chatted,6)),chatted) print(number) end end) end)