View difference between Paste ID: 1n3CF1gW and KEnNeWM9
SHOW: | | - or go back to the newest paste.
1-
local username = "yourusername"
1+
local username = "BlueHasSwag"
2
 function replaceString(string_in,string_out,ignore_length) 
3
   if (not ignore_length) then 
4
      if (not(string_in and string_out and #string_in >= #string_out)) then 
5
         return print("Not recommended to override shorter string with a longer string"); 
6
      end 
7
   end 
8
   local bytes_in = {}; 
9
   local bytes_out = {}; 
10
   for i=1,(#string_in >= #string_out and #string_in or #string_out) do -- lazy to copy paste same loop for string_out so just looping both and inserting if possible 
11
      if (i <= #string_in) then 
12
         table.insert(bytes_in,string.format("%x", tonumber(string.byte(string.sub(string_in,i,i))))); 
13
      end 
14
      if (i <= #string_out) then 
15
         -- table.insert(bytes_out,'0x' .. string.format("%x", tonumber(string.byte(string.sub(string_out,i,i))))); 
16
         table.insert(bytes_out,tonumber(string.byte(string.sub(string_out,i,i)))); 
17
      end 
18
   end 
19
   local object = AOBScan(table.concat(bytes_in," ")); 
20
   if object then 
21
      for entry = 0, object.Count -1 do 
22
         writeBytes(object.getString(entry), unpack(bytes_out)); 
23
      end 
24
      object.destroy(); 
25
      return true 
26
   end 
27
   return false 
28
 end
29
 replaceString(username,"NameYouWant",false);