Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to check if a player's name contains a given phrase?

I had a big problem with this and messed it up so badly that I don't know why I decided to delete the entire script, now I want to do it lustfully.

After joining the player's server, I want the server to check if the player's name contains a given phrase. np."NotFound" or "DreamStan".If the player contains phrases, then print "Something"

I don't really need the entire script (unless it's simple), I just need an article on this topic or a tutorial and what script to place

Sorry to everyone I don't have any script but they blocked me on DevHub and I have nobody to ask for help (because I have no friends)

1 comment

0

string.find would be the function you'd use

1 answer

✓ Accepted answer

You can use string.find

game.Players.PlayerAdded:Connect(function(plr)
	if string.find(plr.Name, 'DreamStan') or string.find(plr.Name,'NotFound') then
		print('ok')
	
	end

	
end)

You can also do


game.Players.PlayerAdded:Connect(function(plr)
	local lower = plr.Name:lower()
	if lower:find('dreamstan') or lower:find('notfound') then
		print('ok')
	
	end

	
end)

1 comment

0

dream stans when they realize that dream is actually slenderman with a mask

This discussion is preserved as it was. New answers, comments, and votes are closed.