How to make a script that finds words used in a string from a table and then replaces the words with new one?
Here's my attempt
local stringtofind = {'are', 'you'}
local stringtoprocess = 'i think you are cool'
local startvalue,endvalue = string.find(stringtoprocess,stringtofind)
local firststring = string.sub(stringtoprocess,1,startvalue-1)
local secondstring = string.sub(stringtoprocess,endvalue+1,string.len(stringtoprocess))
local stringtoinsert = "you're"
local processedstring = firststring .. stringtoinsert ..secondstring
print(processedstring)
Any help?

2 comments
https://developer.roblox.com/articles/Lua-Libraries/string#string.gsub
can you clarify how it is done? because i do not understand