function ToucanBeak(source, find, replace, wholeword)
if wholeword then
find = '%f[%a]'..find..'%f[%A]'
end
return (source:gsub(find,replace))
end
function WaveBeak(message,player)
local newmessage1 = string.lower(message)
local newmessage2 = ToucanBeak(newmessage1, "teemo", "warbler", false)
local newmessage3 = ToucanBeak(newmessage2, "teemoing", "warbler maining", false)
end
Basically ToucanBeak just subs the target word out for something out.
WaveBeak sets everything to lowercase, and then uses ToucanBeak to get the new message.
I intend to do a lot more with this - is there any way I can make it more efficient/use way less local variables?

2 comments
I take it you meant "end" instead of "edn", but also well said.
Thank you!