You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
for context: im trying to make a plugin thats a better ctrl + f, aka it replacing things within the scripts, ive already got everything down besides including magic characters automatically.
Basically, im trying to add a % before every magic character
- What is the issue? Include screenshots / videos if possible!
Ive tried multiple methods, but im not very experienced with strings/tables
for instance, ive tried adding all characters to a table and adding “%” before it, it just crashed studio, ive also tried changing the value in the table to include “%” then the letter, for instance
v = ("%"..v)
but it dosent even change the value
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
the things ive tried are listed above. (sorry for the bad listing)
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local text = v.Source
local magicCharacters = {
".", "^", "$", "(", ")", "[", "]", "*", "+", "-", "?", "!"
}
local characters = string.split(text,"")
for i,v in characters do
if table.find(magicCharacters,v) then
v = ("%"..v)
end
end
this is one of the things i’ve tried, im mostly just looking for a way to be able to do what im trying to achieve
Thank you for reading!
and i apologize for anything i may have typed or said wrong, please ask questions if you have any confusion
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.