Jump to content

Difficulties with Lua patterns


JeViCo

Recommended Posts

Hello everyone. I've recently tried to make roleplay nickname pattern  (example: Nicolas_Cage) but it doesn't work properly

addCommandHandler("checkName",function(pl)
	local name = getPlayerName(pl)
	if string.match(name,"(%u?)(%l+)%_(%u?)(%l+)") then
		outputChatBox("rp nickname")
	else
		outputChatBox("nonrp nickname")
	end
end)

I can use Nikolas_CAgE and it'll match

i used this and this wikis

What am i doing wrong?

Edited by JeViCo
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...