Making lua effect ONLY for specific name?

Status
Not open for further replies.

ManimiFire

Meow Motherfuckers.
Now I'm trying to making lua effect only effect for player with specific name... I tried, but it's hard, maybe someone have idea how to do that, or it's impossible?
 
Use string.find

Code:
if string.find(string.lower(player.name), "name here")
 --do stuff--

"name here" must be between quotes and all in lowercase letters, as string.lower checks for the player's name all in lowercase letters to ignore all random uppercases it could have.
 
Use string.find

Code:
if string.find(string.lower(player.name), "name here")
 --do stuff--

"name here" must be between quotes and all in lowercase letters, as string.lower checks for the player's name all in lowercase letters to ignore all random uppercases it could have.

Ok thank you.
 
I don't know if you really need string.find in this case, that's for finding a specific bunch of characters in a given string mostly (e.g. if you were looking for "sonic" and a player's name was "sonicfan" Lat's code would run, because "sonic" is part of the name even though other letters follow it). If you wanted it only to work if the player has that exact name (but still with string.lower to make it case insensitive) you could just use:

Code:
if string.lower(player.name) == "name here"
    do stuff
end
 
Last edited:
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top