Function that makes you sound silly.


  • I was bored, sitting in ISS at school because I'm a bad kid. So, I made a function that changes a string in Lua to make the sentences sound silly.

    It also lets you customize it.

    Here's what my settings can yield.

    local saying = "I love NitraDev! He's my love! To Devi: You're awesome, keep it up, baby!"
    
    local newSaying = soundDumb(saying)
    
    print(newSaying)
    

    Output:

    "Me luv NiraDev!!! Hes my luv!!! To Devi: you is awesome, keep it up, baby!!!"
    

    Here's a link to the code using Repl.it, or you can look at the code below. Idk, I think it's cool.

    Raw Code (with my settings)

    -- By OldPalHappy
    
    
    -- thing[string] = replace[string]
    
    
    
    local findAndReplace = {-- customize this as you want.
    	-- punctuation
    	["."]       = "!";
    	["!"]       = "!!!";
    	["?"]       = "!?!?";
    	
    	-- basics
    	["i"]       = "me";
    	["an"]      = "uhn";
    	["a"]       = "uh";
    	["get"]     = "gets";
    	["this"]    = "dis";
    	["have"]    = "has";
    	["ever"]    = "evva";
    	["your"]    = "ur";
    	["thanks"]  = "'danks";
    	["love"]    = "luv";
    	
    	-- concatentations
    	["haven't"] = "hasn't";
    	["you're"]  = "you is";
    	["i'm"]     = "I is";
    	["don't"]   = "dun't";
    	
    	-- adding "s"
    	["hope"]    = "hopes";
    	["thank"]   = "thankies";
    	
    	-- adding "z"
    	["its"]     = "itz";
    	["flies"]   = "flyz";
    	["loves"]   = "luvz"
    }
    
    local deleteVowelChance      = 20/100 -- 20%
    local deleteConsonantsChance = 10/100 -- 10%
    
    
    
    
    local function soundDumb(s)
    	local new = ""
    	for sentence,punctuation in s:gmatch("([^.!?]*)([.!?]*)") do
    		local startOfSentence = true
    		for word in sentence:gsub("%.",""):gmatch("%S+") do
    			local replace = findAndReplace[word:lower()]
    			if(replace)then
    				if(startOfSentence)then
    					replace = replace:sub(1,1):upper()..replace:sub(2)	
    				end
    			elseif(#word>3)then
    				local newWord = word
    				for i = 2,#word-1 do
    					local deleteChance = (word:sub(i,i):find("[AEIOUaeiou]"))and vowelDeleteChance or deleteConsonantsChance
    					if(math.random()<deleteChance)then
    						newWord = newWord:sub(1,i-1).." "..newWord:sub(i+1)
    					end
    				end
    				word = newWord:gsub(" ","")
    			end
    			new = new.." "..(replace or word)
    			startOfSentence = false
    		end
    		if(punctuation)then
    			new = new..(findAndReplace[punctuation] or punctuation)
    		end
    	end
    	return new:sub(2);
    end
    
    local saying = [[
    		I love NitraDev! He's my love! To Devi: You're awesome, keep it up, baby!
    ]]
    
    local newSaying = soundDumb(saying)
    
    print(newSaying)
    

    Note:


    Don't use this as a chat filter, because you can bypass it pretty easy. It's just to make text look stupid.


  • Accoring to all known laws of aviaton, der is no way uh bee sould be able to fly! Itz wings are too small to gets itz fat 'lil body off the ground! The bee, of course, flyz anywayz becuz bees dun't care what humans think is impoible! Yellow, blak! Yllow, blck! Yellow, black! Yellow, blck! Ooh, back and yellw!!! Let's shake it up uh 'lil! Barry!!! Breakfat is ready!!! Oomig!!! Hng on uh second! Helo!?!? - Barry!?!? - Adam!?!? - Oan you beleve dis is haenng!?!? - me cant! I'll pick you up! Loking sharp! Use the stais! Ur fater pid god money for thse! Sorry! I is excitd! Here's the grauate! We're very proud of yu, son! Uh perfect reprt card, all B's! Very proud! Ma!!! Me got uh ting going here! - You got lint on ur fuz! - Ow!!! Tht's me!!! - Wae to us!!! We'll be in row 118,000! - Bye!!! Barry, me told you, sop flying in the huse!!! - Hey, Adam! - Hey, Barry! - Is that fuzz gel!?!? - uh 'lil! Special day, gradaton! Never thought I'd make it! Three dys grae school, thee days high school! Those were awkward! Three das college! I is glad me tok uh day and hitchhked around the hive! You did come bck different! - Hi, Barry! - Atie, growing uh musache!?!? Loos good! - Hear about Frankie!?!? - Yeah! - You going to the funerl!?!? - No, I is not going! Everyody knows, sting somene, you die! Dun't waste it on uh sqirrl! Such uh hothead! Me guess he could has just gottn out of the way! Me luv dis incorporating uhn amusement park into our day! Ta's why we dun't need vacations! Boy, quite uh bit of pomp... under the circustanes! - Well, Ada, today we are men! - We are!!! - Bee-men! - Amen!!! Hlelujah!!! Studets, facuy, distingished bees, please wlcome Dean Buzwell! Welcome, New Hive Oity graduating class of...... 9:15! That concludes our ceremoies! And begins ur career at Honex Idusries!!! Wll we pick ourjob tday!?!? Me heard it's just orientation! Heads up!!! Here we go! Keep ur hands and anennas inside the trm at all times! - Wonder what it'll be like!?!? - uh 'lil scry!


  • Love it. LOVE IT.

    I FAKING LOVV IT BOII


  • @Aimarekin Thanks <3


  • Hello!!! My nme is Aimarekin, but me hopes dis message doen't gets derp... Actualy, dis script is really cl! Did you kew scripts cntan txt!?!? Amaing!!! Lol not really

    I made this with your script. Lol! I really like it!

    BUT....
    You forgot to replace "Really" with "rly"
    lol


  • @Aimarekin Yeah, I've been making a few changes to a different version I plan on using for a discord bot >:3

    I is evil!

    Feel free to edit the script as well :3



  • Great!

    Me has type in something and me pressed enter, no fake!!!

    Some suggestions:

    Have a chance of replacing "ss" with "s" (Should be high, maybe 80%)
    Example: I pressed = Me presed

    Replace "Hello" with "Hai"
    Example: Hello there = Hai ther

    Replace "mom " or "mum" with "moum"
    Example: Mom! = Moum!


  • @Aimarekin Well I made it easy to customize for a reason. :P


Log in to reply
 

Looks like your connection to Scripting Helpers was lost, please wait while we try to reconnect.