Any way to detect parts of player's name

So like I wanna make an auto rank for a clan so when they join the game it checks if player has like Test_(their name) is there actually any way to do that?

sure, with string.find, I’ll write an example using string.gsub as well to show how to pull that part out of the name:

local function isInClan(name)
	if string.find(name, "Test_") then
		print(string.gsub(name, "Test_", "") .. " is part of the clan :-)")
	else
		print(name .. " is not part of the clan :-(")
	end
end

isInClan("Test_abc") --> is in clan
isInClan("123") --> is not in clan

You’d adapt this to a PlayerAdded event to use their display name instead

1 Like

Tysm ill try it soon! Its pretty cool