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

How do I make a command on where it still works even if you add a letter?

Alright, the title name is confusing, but let me tell what I'm trying to do: I'm working on my own admin, and I've learned some cool stuff while working on the admin! Now, the thing I am doing a command. I will use :re for example. So, say like if you say :re, you respawn. Simple! But here is the thing, I want to figure out on when you add another letter, like :ree, it will still respawn you.

If you're still confused, I'll explain it one more time. You say :re, it respawns you! But if you accidently add 1, or more letters, it will still respawn you. For example, you say it like :ree instead of :re, it will still respawn you.

1 answer

✓ Accepted answer

if this is what you want to do then use the find built in function that looks for the word re in your chat if it detects it then run your code maybe something like

local str = "this is player input"
if str:find("the command :re") then
	print("run command :re")
end

btw replace the strings in the parentheses with the actual inputs and don't use the print run the command also make sure you have turned them into strings

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