Is it possible, when using string.gsub, to replace a character oat one position in a string with a different character from another string at the same location as the original?
For example, here's what I have
Cake = workspace.Cake -- Cake is a StringValue
----Many lines later..
local RealCake = Cake.Value
local FakeCake1 = string.gsub(RealCake, "%w", "-") --Changes every letter in 'Cake' to be a Hyphen, only in the FakeCake1 Variable.
function Randomizer(thing)
FakeCake1 = string.gsub(RealCake, "-", ( --Where I've hit a wall in the script creating process.
end
What I'm trying to get it to do is every time the function 'Randomizer' is called, it will look for the position of a letter/number in RealCake, and replace a hyphen in that same position in FakeCake1 with that letter from RealCake.
Is it possible to use gsub for this? Or should I approach this using a different method? Any help is appreciated, ad if I need to clarify anything please let me know. Thanks! :)

4 comments
Trying to make hangman?
Something of the sort.
Don't add `.Value' to RealCake. Instead place it on line 05 'RealCake.Value' or Cake.Value.
RealCake and FakeCake are in a function. I'm not defining the Value globally because it can change. If I did it globally, it would forever stay one value.