So Im making a Say command that will let you add an AI Voice. Im having trouble with this part of the script.
CAP stands for Check And Play The cap function will check the Letter and match it with the corresponding sound, then play the sound.
function Say(fullmsg)
lowermsg=string.lower(fullmsg)
msg=string.gsub(lowermsg,"ing","A")-- A will play the ing sound
msg=string.gsub(msg,"ch","B") -- B will play the ch sound
local msg=string.gsub(msg,"wh","C") -- C will play the wh sound
Amount = string.len(msg)
Number=1
repeat
Number=Number+1
cap(string.sub(msg,Number)) -- I think my problem is here
until
Number==Amount
end
I have a feeling the problem is the function calls more than one letter. Can someone help me? Just ask me in chat with "@fancyboby47" if you need further explanations!
Thank you!

1 comment
Look, I understand what Chatted and connect are, and I know very well how to use them. The reason I did't use them is because I dont want this function to be just for Chat. Also, your code is far from what Im trying to do. I think what Im trying to do is over your level, so if you dont understand the code, please dont try to correct me. Thanks for the much appreciated effort though.