Jump to content

SOLVED(string.gsub)


Karoffe

Recommended Posts

Firstly if i am going to change everyone's name entering the server if he has a "_" to "" then how can i even check if he has "_", secondly how to apply this example on many typing characters, for example if i want to avoid everyone from typing numbers in mainchat ?

Link to comment

Well, the function itself already checks if there is a _ in the given string. So don't worry about that, you should rename players without the underscore. Just remove it while typing etc. To remove numbers you can use the parameter %W like this;

local name = name:gsub ( "%W", "" ); 

Link to comment

Well, actually i wanted if someone changing his nick to something that contains numbers then a gui shows telling him that he couldn't change his nick to that name. i wanted gsub to automatically change it without numbers

So, how to check the entered nick if it contains numbers or not(without changing it)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...