Godofadmin1337

Kawakie's Message Bot

May 7th, 2020
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.15 KB | None | 0 0
  1. math.randomseed(os.time())
  2. wait(1)
  3. --settings
  4. local whisper = false --Toggle this if you want whisper chat to appear globablly
  5. local gui = true --Toggle this if you want gui to appear
  6. local prefix = "!" --chat prefix for the commands
  7. --settings end
  8. ScreenGui0 = Instance.new("ScreenGui")
  9. ImageLabel1 = Instance.new("ImageLabel")
  10. TextButton2 = Instance.new("TextButton")
  11. ImageLabel3 = Instance.new("ImageLabel")
  12. ScrollingFrame4 = Instance.new("ScrollingFrame")
  13. TextButton5 = Instance.new("TextButton")
  14. UIListLayout6 = Instance.new("UIListLayout")
  15. TextLabel7 = Instance.new("TextLabel")
  16. ScreenGui0.Parent = game.Players.LocalPlayer.PlayerGui
  17. ScreenGui0.DisplayOrder = 999999998
  18. ScreenGui0.Enabled = gui
  19. ScreenGui0.ResetOnSpawn = false
  20. ImageLabel1.Name = "Frame"
  21. ImageLabel1.Parent = ScreenGui0
  22. ImageLabel1.Position = UDim2.new(1.00999999, 0, 0.5, 0)
  23. ImageLabel1.Size = UDim2.new(0.150000006, 0, 0.300000012, 0)
  24. ImageLabel1.AnchorPoint = Vector2.new(1, 0)
  25. ImageLabel1.BackgroundColor = BrickColor.new("Black")
  26. ImageLabel1.BackgroundColor3 = Color3.new(0.184314, 0.192157, 0.211765)
  27. ImageLabel1.BackgroundTransparency = 1
  28. ImageLabel1.Image = "rbxassetid://3570695787"
  29. ImageLabel1.ImageColor3 = Color3.new(0.184314, 0.192157, 0.211765)
  30. ImageLabel1.ScaleType = Enum.ScaleType.Slice
  31. ImageLabel1.SliceCenter = Rect.new(100, 100, 100, 100)
  32. ImageLabel1.SliceScale = 0.12
  33. TextButton2.Parent = ImageLabel1
  34. TextButton2.Position = UDim2.new(0.49000001, 0, 0.0700000003, 0)
  35. TextButton2.Size = UDim2.new(0.800000012, 0, 0, 50)
  36. TextButton2.AnchorPoint = Vector2.new(0.5, 0)
  37. TextButton2.BackgroundColor = BrickColor.new("Earth green")
  38. TextButton2.BackgroundColor3 = Color3.new(0.211765, 0.223529, 0.247059)
  39. TextButton2.BackgroundTransparency = 1
  40. TextButton2.BorderSizePixel = 0
  41. TextButton2.ZIndex = 3
  42. TextButton2.Font = Enum.Font.Gotham
  43. TextButton2.FontSize = Enum.FontSize.Size28
  44. TextButton2.Text = "Whisper: False"
  45. TextButton2.TextColor = BrickColor.new("Institutional white")
  46. TextButton2.TextColor3 = Color3.new(1, 1, 1)
  47. TextButton2.TextScaled = true
  48. TextButton2.TextSize = 28
  49. TextButton2.TextWrap = true
  50. TextButton2.TextWrapped = true
  51. ImageLabel3.Name = "TextButton_Roundify_4px"
  52. ImageLabel3.Parent = TextButton2
  53. ImageLabel3.Position = UDim2.new(0.5, 0, 0.5, 0)
  54. ImageLabel3.Size = UDim2.new(1, 0, 1, 0)
  55. ImageLabel3.Active = true
  56. ImageLabel3.AnchorPoint = Vector2.new(0.5, 0.5)
  57. ImageLabel3.BackgroundColor = BrickColor.new("Institutional white")
  58. ImageLabel3.BackgroundColor3 = Color3.new(1, 1, 1)
  59. ImageLabel3.BackgroundTransparency = 1
  60. ImageLabel3.Selectable = true
  61. ImageLabel3.ZIndex = 2
  62. ImageLabel3.Image = "rbxassetid://3570695787"
  63. ImageLabel3.ImageColor3 = Color3.new(0.211765, 0.223529, 0.247059)
  64. ImageLabel3.ScaleType = Enum.ScaleType.Slice
  65. ImageLabel3.SliceCenter = Rect.new(100, 100, 100, 100)
  66. ImageLabel3.SliceScale = 0.12
  67. ScrollingFrame4.Parent = ImageLabel1
  68. ScrollingFrame4.Position = UDim2.new(0.49000001, 0, 0.949999988, 0)
  69. ScrollingFrame4.Size = UDim2.new(0.800000012, 0, 0.550000012, 0)
  70. ScrollingFrame4.Active = true
  71. ScrollingFrame4.AnchorPoint = Vector2.new(0.5, 1)
  72. ScrollingFrame4.BackgroundColor = BrickColor.new("Earth green")
  73. ScrollingFrame4.BackgroundColor3 = Color3.new(0.211765, 0.223529, 0.247059)
  74. ScrollingFrame4.BorderSizePixel = 0
  75. ScrollingFrame4.CanvasSize = UDim2.new(0, 0, 0, 0)
  76. TextButton5.Parent = ScrollingFrame4
  77. TextButton5.Size = UDim2.new(1, 0, 0, 30)
  78. TextButton5.BackgroundColor = BrickColor.new("Black")
  79. TextButton5.BackgroundColor3 = Color3.new(0.184314, 0.192157, 0.211765)
  80. TextButton5.BorderColor = BrickColor.new("Institutional white")
  81. TextButton5.BorderColor3 = Color3.new(1, 1, 1)
  82. TextButton5.Font = Enum.Font.Garamond
  83. TextButton5.FontSize = Enum.FontSize.Size32
  84. TextButton5.TextColor = BrickColor.new("Tr. Flu. Blue")
  85. TextButton5.TextColor3 = Color3.new(0.870588, 0.909804, 1)
  86. TextButton5.TextScaled = true
  87. TextButton5.TextSize = 30
  88. TextButton5.TextWrap = true
  89. TextButton5.TextWrapped = true
  90. TextButton5.TextXAlignment = Enum.TextXAlignment.Left
  91. TextButton5.TextYAlignment = Enum.TextYAlignment.Top
  92. TextButton5.Visible = false
  93. UIListLayout6.Parent = ScrollingFrame4
  94. UIListLayout6.SortOrder = Enum.SortOrder.LayoutOrder
  95. TextLabel7.Parent = ImageLabel1
  96. TextLabel7.Position = UDim2.new(0.49000001, 0, 0.270000011, 0)
  97. TextLabel7.Size = UDim2.new(0.800000012, 0, 0.100000001, 0)
  98. TextLabel7.AnchorPoint = Vector2.new(0.5, 0)
  99. TextLabel7.BackgroundColor = BrickColor.new("Institutional white")
  100. TextLabel7.BackgroundColor3 = Color3.new(1, 1, 1)
  101. TextLabel7.BackgroundTransparency = 1
  102. TextLabel7.Font = Enum.Font.SourceSans
  103. TextLabel7.FontSize = Enum.FontSize.Size14
  104. TextLabel7.Text = "Tags:"
  105. TextLabel7.TextColor = BrickColor.new("Institutional white")
  106. TextLabel7.TextColor3 = Color3.new(1, 1, 1)
  107. TextLabel7.TextScaled = true
  108. TextLabel7.TextSize = 14
  109. TextLabel7.TextWrap = true
  110. TextLabel7.TextWrapped = true
  111. TextBox0 = Instance.new("TextBox")
  112. TextBox0.Parent = ScreenGui0
  113. TextBox0.Position = UDim2.new(0.850000024, 0, 0.75, 0)
  114. TextBox0.Size = UDim2.new(0.135000005, 0, 0.200000003, 0)
  115. TextBox0.AnchorPoint = Vector2.new(1, 1)
  116. TextBox0.BackgroundColor = BrickColor.new("Earth blue")
  117. TextBox0.BackgroundColor3 = Color3.new(0.211765, 0.223529, 0.247059)
  118. TextBox0.Font = Enum.Font.Gotham
  119. TextBox0.FontSize = Enum.FontSize.Size28
  120. TextBox0.Text = ""
  121. TextBox0.TextColor = BrickColor.new("Institutional white")
  122. TextBox0.TextColor3 = Color3.new(1, 1, 1)
  123. TextBox0.TextSize = 25
  124. TextBox0.TextWrap = true
  125. TextBox0.TextWrapped = true
  126. TextBox0.PlaceholderText = "Change Tag Description"
  127. TextBox0.Visible = false
  128.  
  129. --gui end
  130. local countcommandamount= 0
  131. local count = 0
  132. local split = " "
  133.  
  134. local function animation(id,speed)
  135. local Anim = Instance.new("Animation")
  136. Anim.AnimationId = "rbxassetid://"..id
  137. local k = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(Anim)
  138. k:Play()
  139. k:AdjustSpeed(speed)
  140. end
  141. local function splitString(str,delim)
  142. local broken = {}
  143. if delim == nil then delim = "," end
  144. for w in string.gmatch(str,"[^"..delim.."]+") do
  145. table.insert(broken,w)
  146. end
  147. return broken
  148. end
  149. local function addtag(name)
  150. local newtag = TextButton5:Clone()
  151. newtag.Name = name
  152. newtag.Text = name
  153. newtag.Visible = true
  154. ScrollingFrame4.CanvasSize = ScrollingFrame4.CanvasSize + UDim2.new(0,0,0.11,0)
  155. newtag.Parent = ScrollingFrame4
  156. newtag.MouseButton1Click:Connect(function()
  157. TextBox0.Visible = true
  158. TextBox0.Name = name
  159. end)
  160. end
  161. function shortName(t)
  162. local matches= {}
  163. for _, player in ipairs (game.Players:GetPlayers()) do
  164. if string.lower(player.Name):match(string.lower(t)) then
  165. table.insert(matches, player)
  166. end
  167. end
  168. if #matches == 1 then
  169. return matches[1]
  170. else
  171. return nil
  172. end
  173. end
  174. function onChatted(msg, recipient, speaker)
  175. if speaker.Name == game.Players.LocalPlayer.Name then count = count + 1 end
  176. local whotosendto = "All"
  177. -- if publicchat == false then whotosendto = speaker.Name end
  178. if count <= 5 then
  179. local args = splitString(msg, split)
  180. local source = string.lower(speaker.Name)
  181. msg = string.lower(msg)
  182. local didcommand = false
  183. local reply = ""
  184.  
  185. if string.sub(msg, 1,5) == prefix.. "help" then
  186. didcommand = true
  187. if args[2] == nil then args[2] = "1" end
  188. if args[2] == "1" then reply = "prefix [" ..prefix.. "]: funfact, edgyfact, yomama, info, credits, dis, die, goto, count, dance, 8ball"
  189. elseif args[2] == "2" then reply = "createtag <name> <description>, tag <name>"
  190. else reply = "Unknown Page" end
  191. elseif string.sub(msg, 1,9) == prefix.. "edgyfact" then
  192. didcommand = true
  193. local possiblereplies = {"Gay people are more likely to have mental illness","Childhood abuse has been linked to becoming gay","Gay people suffer a lot more abuse then straight people.","People in LGBT have a higher chance of being depressed.","LGBT members have a higher chance of gaining disorders like eating disorders.","People in LGBT grow up more likely to live in poverty","Coronavirus wouldn't have spread this much if people took it seriously.","Everything you do on ROBLOX is being sold to private companies.","We are all going to die eventually.","We are just a floating rock in space of emptiness. We are the only living creatures."}
  194. local random = math.random(1,#possiblereplies)
  195. reply = tostring(possiblereplies[random])
  196. elseif string.sub(msg, 1,8) == prefix.. "funfact" then
  197. didcommand = true
  198. local possiblereplies = {"Glitter was accidentally invented by a New Jersey cattle rancher.","Hawaiian pizza was invented by a Greek man in Canada.","S. President Theodor Roosevelt had a pet hyena.","Walmart accepts fewer applicants than Harvard.","The world’s first cosmonaut was a dog.","Hitler’s nephew earned a Purple Heart fighting for the Allies in World War II.","More than half the world’s population is under 30.","A day is longer than a year on Venus.","The world’s oldest operational hotel was built in 705AD.","The Eiffel Tower is shorter in winter than in summer.","Russia was founded by Vikings.","Ketchup was invented in China.","Armadillos are bulletproof.","A Superman coin is legal tender in Canada.","Abraham Lincoln was a licensed bartender. ","All blue-eyed people have a common ancestor.","A toddler could fit inside a blue whale’s arteries.","There are more than 200 dead bodies on Mount Everest.","A UK researcher developed a chili pepper so hot it could kill you.","The tallest man in history was 8’11” tall.","There are 2,000 thunderstorms in progress at any given moment.","Workers are most productive on Mondays. ","May 5th is Cartoonist Day.","Did you know the inventor of the Frisbee was turned into one after his death?","Did you know carrots weren’t always orange?","Did you know the active ingredient in dynamite is used to treat heart attacks?","Did you know Oreos are vegan?","Did you know peanuts aren’t actually nuts?","The human eye can detect the light of a candle from over a mile away.","80% of taste is determined by aroma.","About 99.9% of human genes are identical.","You can tell if someone really likes you by looking at their feet while you talk.","The oldest “your mom” joke dates from ancient Babylonia. ","Penguin urine makes up about 3% of Antarctica’s glaciers. ","The sandwich was invented so a noble could gamble longer.","The name for the fear of long words is 36 letters long. ","There is a medical procedure to remove the sense of fear.","Every panda in a zoo around the world is on loan from China.","Sliced bread wasn’t invented until 1928.","Hippopotamuses kill more people each year than lions, sharks, and wolves combined.","Grapes are toxic to dogs.","The ancient Greeks may have used computers.","More than 3 billion people watched the 2014 FIFA World Cup.","A lion’s roar is louder than a lawnmower.","Only two countries use purple in their national flag","Wombats have cube-shaped poop.","Footprints left on the moon’s surface will last for a million years.","Some snakes can sense when an earthquake is coming.","Roundworms can survive over 30,000 frozen in ice.","There are over two dozen states of matter.","Killer whales aren’t really whales.","90% of the world’s fresh water is in Antarctica.","The largest natural cave is twice the size of Wembley Stadium.","The average human body is home to between 2 and 6 pounds of bacteria."}
  199. local random = math.random(1,#possiblereplies)
  200. reply = tostring(possiblereplies[random])
  201. elseif string.sub(msg, 1,10) == prefix.. "createtag" then
  202. didcommand = true
  203. local tag = Instance.new("StringValue",game.Players.LocalPlayer)
  204. tag.Name = args[2]
  205. local waitwhat = string.len(args[2]) + 12
  206. tag.Value = string.sub(msg,waitwhat)
  207. reply = "Created tag " ..args[2]
  208. addtag(args[2])
  209. elseif string.sub(msg, 1,4) == prefix.. "tag" then
  210. didcommand = true
  211. if game.Players.LocalPlayer:FindFirstChild(args[2]) then
  212. reply = game.Players.LocalPlayer[args[2]].Value
  213. end
  214. elseif string.sub(msg, 1,5) == prefix.. "info" then
  215. didcommand = true
  216. reply = "Hi! I am running a script that allows players to run commands. These commands can control my chat, character and more! " ..prefix.. "help to view commands."
  217. elseif string.sub(msg, 1,8) == prefix.. "credits" then
  218. didcommand = true
  219. reply = "This script was created by Kawakie (kawakie#.3999), inspiration comes from KonekoKitten"
  220. elseif string.sub(msg, 1,7) == prefix.. "yomama" then
  221. didcommand = true
  222. local possiblereplies = {"Yo mama's so fat, when she fell I didn't laugh, but the sidewalk cracked up.","Yo mama's so fat, when she skips a meal, the stock market drops.","Yo mama's so fat, it took me two buses and a train to get to her good side.","Yo mama's so fat, when she goes camping, the bears hide their food.","Yo mama's so fat, if she buys a fur coat, a whole species will become extinct.","Yo mama's so fat, I swerved to miss her in my car and ran out of gas.","Yo mama's so fat, when she wears high heels, she strikes oil.","Yo mama's so fat, she was overthrown by a small militia group, and now she's known as the Republic of Yo Mama.","Yo mama's so fat, when she sits around the house, she SITS AROUND the house.","Yo mama's so fat, she can't even jump to a conclusion.","Yo mama's so fat, if she was a Star Wars character, her name would be Admiral Snackbar.","Yo mama's so fat, she brought a spoon to the Super Bowl.","Yo mama's so stupid when they said it was chilly outside, she grabbed a bowl.","Yo mama's so stupid, she put lipstick on her forehead to make up her mind.","Yo mama's so stupid, when they said, 'Order in the court,' she asked for fries and a shake.","Yo mama's so stupid, she thought a quarterback was a refund.","Yo mama's so stupid, when I told her that she lost her mind, she went looking for it","Yo mama's so stupid when thieves broke into her house and stole the TV, she chased after them shouting 'Wait, you forgot the remote!'","Yo mama's so stupid, she went to the dentist to get a Bluetooth.","Yo mama's so stupid, she put airbags on her computer in case it crashed.","Yo mama's so ugly, she threw a boomerang and it refused to come back.","Yo mama's so old, her social security number is one.","Yo mama's so ugly, she made a blind kid cry.","Yo mama's so ugly, her portraits hang themselves.","Yo mama's so ugly, when she was little, she had to trick-or-treat by phone.","Yo mama's so ugly, she looked out the window and was arrested for mooning.","Yo mama's so poor, the ducks throw bread at her.","Yo mama's so poor, she chases the garbage truck with a grocery list.","Yo mama's so poor, she can't even afford to pay attention.","Yo mama so scary, the government moved Halloween to her birthday.","Yo mama's so nasty, they used to call them jumpolines 'til yo mama bounced on one.","Yo mama's so poor, Nigerian princes wire her money.","Yo mama so dumb, she went to the eye doctor to get an iPhone."}
  223. local random = math.random(1,#possiblereplies)
  224. reply = tostring(possiblereplies[random])
  225. elseif string.sub(msg, 1,6) == prefix.. "count" then
  226. didcommand = true
  227. countcommandamount = countcommandamount + 1
  228. reply = "This command has been used " .. tostring(countcommandamount) .. " times."
  229. elseif string.sub(msg, 1,4) == prefix.. "age" then
  230. didcommand = true
  231. if args[2] == nil then args[2] = speaker.Name end
  232. local playertodoitto = shortName(args[2])
  233. reply = playertodoitto.Name.. "'s account age is " ..playertodoitto.AccountAge
  234. elseif string.sub(msg, 1,4) == prefix.. "die" then
  235. didcommand = true
  236. reply = ""
  237. game.Players.LocalPlayer.Character.Humanoid.Health = 0
  238. elseif string.sub(msg,1,6) == prefix.. "dance" then
  239. didcommand = true
  240. animation(35654637,1)
  241. elseif string.sub(msg,1,6) == prefix.. "8ball" then
  242. didcommand = true
  243. local possiblereplies = {"All signs point to yes...", "Yes!", "My sources say nope.", "You may rely on it.", "Concentrate and ask again...", "Outlook not so good...", "It is decidedly so!", "Better not tell you.", "Very doubtful.", "Yes - Definitely!", "It is certain!", "Most likely.", "Ask again later.", "No!", "Outlook good.", "Don't count on it."}
  244. local random = math.random(1,#possiblereplies)
  245. reply = speaker.Name .. ", " .. tostring(possiblereplies[random])
  246. elseif string.sub(msg, 1,5) == prefix.. "goto" then
  247. didcommand = true
  248. reply = ""
  249. if args[2] == nil then args[2] = speaker.Name end
  250. local playertodoitto = shortName(args[2])
  251. game.Players.LocalPlayer.Character:MoveTo(playertodoitto.Character.Head.Position + Vector3.new(0,1,0))
  252. elseif string.sub(msg,1,2) == "/w" or string.sub(msg,1,7) == "/whisper" or string.sub(msg,1,5) == "/team" or string.sub(msg,1,2) == "/t" then
  253. if whisper then
  254. didcommand = true
  255. reply = "[from " ..speaker.Name.. "]: " ..string.sub(msg, 4)
  256. end
  257. end
  258. if didcommand and reply ~= "" then wait(0.1) game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest:FireServer(">Bot: " ..reply,whotosendto) end
  259. else
  260. if count == 6 then game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest:FireServer("Please wait to prevent anti-chat spam from kicking in.",whotosendto) end
  261. end
  262. end
  263.  
  264. TextButton2.MouseButton1Click:Connect(function()
  265. whisper = not whisper
  266. TextButton2.Text = "Whisper: " .. tostring(whisper)
  267. end)
  268.  
  269. TextBox0.FocusLost:Connect(function(enterPressed, inputThatCausedFocusLost)
  270. if enterPressed then
  271. game.Players.LocalPlayer[TextBox0.Name].Value = TextBox0.Text
  272. TextBox0.Visible = false
  273. end
  274. end)
  275.  
  276. for i, newPlayer in pairs(game.Players:GetPlayers()) do
  277. newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
  278.  
  279. end
  280.  
  281.  
  282. function onPlayerEntered(newPlayer)
  283. newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
  284. game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest:FireServer(newPlayer.Name .. " has joined the server","All")
  285. count = count + 1
  286. end
  287.  
  288. game.Players.ChildAdded:connect(onPlayerEntered)
  289.  
  290. wait(2)
  291. game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest:FireServer("(V1.6) " ..game.Players.LocalPlayer.Name.. " has run Message Bot V1.5, use " ..prefix.. "help to view the commands!","All")
  292.  
  293. while wait(4) do
  294. count = count - 1
  295. end
Add Comment
Please, Sign In to add comment