Hi. I am making a radio system for a game and I want to make it so the further the person who sent the message is from you, the more corrupted and unreadable their message is.
I can’t figure out how I would loop through every letter in the string. I got everything down but that. Any help is appreciated!
local nstring = ""
for i,v in pairs(string.split(msg,"")) do
if math.round(math.random()*string.len(msg)) > i/1.5 then
nstring = nstring .. tostring(math.floor(math.random()*100)) -- scatter text, msg becomes higher chance of readable further along
else
nstring = nstring .. v
end
end