if string.find(gui.TextBox.Text,"ff;") then --local pattern="^ff;%w+" local match=(gui.TextBox.Text):match("^ff;%w+") if match then local var=string.lower(string.match(match,".+",4)) for _,v in pairs(game.Players:GetPlayers()) do local player=string.lower(v.Name) if var==string.sub(player,1,4) then local forcefield=Instance.new("ForceField", v.Character) end end if string.match(gui.TextBox.Text,"^ff;me$") then local forcefield=Instance.new("ForceField", Char) end end end
So I really want to improve on this, because it truly looks very ugly. But i'm usin it for now (I made it), anyways the problem is the fact that some players have ridiculously long names on purpose, for example: "JohnCenaLover59595959422", and let's say I want to forcefield them, instead of typing that out, can I just make it so I only have to say: ff;john
Thanks!