Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
-2

How can you make a line on a script that does this?

Asked by 5 years ago

I'm trying to make a script where you can chat to a model and the model responds back to you. Here's my script:

local PlayerKeywords1 = { "yo", "ye", "hello", "hi", "wassup", "sup", "hellur", "ni hao", "hola", "hai"
} local PlayerKeywords2 = { "good", "g00d", "nice", "great" }

local PlayerKeywords3 = { "uw0tm8", "u w0t m8", "y u", "wuv", "luv", "w0t", "w8", "fien" }

local PlayerKeywords4 = { "pie", "food", "trains", "houses", "toilets", "power", "roblox", "robloxians", "celebrities", "people", "world", "youtube", "twitter", "ig", "instagram", "studio" }

local PlayerKeywords5 = { "ikr", "i know right", "okay", "ok", "kk", "k", "kay", "kai", "what", "really", "crazy", "bad", "whet", "heh", "huh", "sorry" }

local PlayerKeywords6 = { ":o", ":/", ";o", ";)", ";')", ":)", ";(", ";'(", ":(", ":3", "?", "?.?", "OoO", "O>O", "v.v", ">.>", "<.<", "(>^.^)>", "<(^.^<)", "^.^", ":I", ":|", "o.o", ":P", "xD", "XD", "xd", "c:", ":c", "c;", ";c", ";'c", "C:", "C;", "C;", "o-o", }

local PlayerKeywords7 = { "bye", "bai", "cya", "see ya", "later", "peace", "dueces", "goodbye", "gudbye", "g00dbai", "goodbai", "gudbai", "g00dbye" } local Dialog1 = { "Wassup bruh?", "yeeee supppp", "Hello, mate!", "hi :3", "sup..", "Wassup... geez..", "What is that?", "I DUNT SPEAK YO LANGUAGE!!1!1!", "haiiii!!!" }

local Dialog2 = { "Thank ya!", "Thanks!", "Thank you!", "You're great!" }

local Dialog3 = { "i dunt want chu", "i dunt want chuuu", "w0t", "i wuv u 2", "i luv u 2", "w0t 2 u 2", "wait 4 w0t?", "thank chu!!1!1!" }

local Dialog4 = { "I like pie!", "Ew food!", "Eh, trains arn't that bad..", "houses....house..HOUSE!!", "By the way, I need to go pee!!!", "I OVAP0W3R CHU!!", "Roblox is fun! But it gets boring after awhile", "I dunt knoe...", "I'm not a mainstream person..", "People.. I like people!", "Global warming is bad...", "Youtube, we broadcast everywhere!", "Follow me on twitter! I'm NoobyNoobCaiks!", "I rarely get on instagram... so.", "Roblox studio is a twist!" }

local Dialog5 = { "I knoww", "I knowww", "mhm", "okay..", "Huh?", "Yes really.", "yeah ik u cray cray 2", "yah im badddd", "Yasss", "hehehehe c:", "stares", "It's okay! c:", }

local Dialog6 = { "o-o", "I don't like faces!" }

local Dialog7 = { "Goodbye!" }

local DialogExtra = { "I don't understand you..", "ye okay doesn't understand", "Don't quite understand ya!", "What...", "Really? That language scares me...", "I understand bruh!!! doesn't understand", ">.> <.< runs", "So much weird languageeee", "Hey, I don't really understand." }

function StartChat(Plr) for _,v in pairs(game.Workspace:GetChildren()) do if (v:IsA("Model")) then if v:findFirstChild("Humanoid") ~= nil then if v:findFirstChild("Torso") ~= nil then if (script.Parent.Position - v:findFirstChild("Torso").Position).magnitude <= 5 then Plr.Chatted:connect(function(msg) if msg:lower():sub(1,2) == {PlayerKeywords1[4],msg} end) end end end end end end````

~~~~~~~~~~~~~~~~~

I want the model to active when the player says one of the keywords in that array. I want it to be that the player can say anything else with it after, before, or both. Is it any possible way to do this?

1
Put your code in a Code Block please DigitalVeer 1458 — 5y
1
Code block your script. Copy and paste the code, then on the very right (While in edit) you'll see an icon on the very right that will make lines of "~~~", inside of the two lines, paste your script alphawolvess 1784 — 5y
0
Code block you're script. raid6n 2119 — 10mo

Answer this question