Inoob8C

auto respond

Apr 3rd, 2022
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. local HttpService = game:GetService("HttpService")
  2. local Players = game:GetService("Players")
  3. local UserInputService = game:GetService("UserInputService")
  4.  
  5. --I based this script on ChatBot, but with the SimSimi api, therefore it has more accurate and fun answers XD
  6.  
  7. --Modify these parameters as you want--
  8.  
  9. local idioma = "en" --Here is the language you want SimSImi to respond to, es for "EspaƱol", en for "English"
  10.  
  11. local chatfuel = "True" --If you want me to censor the swearing "True" or "False"
  12.  
  13. --From here down I don't recommend moving him if you don't know Lua
  14.  
  15. local function mensajepro(mensaje, jugador) --In this function the magic happens
  16. local texto = mensaje
  17. local Responde = game:HttpGet("https://api.simsimi.net/v2/?text="..texto.."&lc="..idioma.."&cf="..chatfuel) --The SimSImi api is called
  18. local datos = HttpService:JSONDecode(Responde)
  19.  
  20. wait()
  21.  
  22. game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest:FireServer(jugador.." "..datos.success, "All") --A message is sent with the response of SimSImi
  23. end
  24.  
  25.  
  26. Players.PlayerChatted:Connect(function(type, plr, message) --When a player speaks
  27. for _,plrs in pairs(game.Players:GetPlayers()) do
  28.  
  29. if (Players.LocalPlayer.Character.HumanoidRootPart.Position - plrs.Character.HumanoidRootPart.Position).magnitude <= 10 then --If the player is nearby, SimSimi will read their message.
  30. if plr.Name == plrs.Name then
  31. mensajepro(message, plr.Name) --The function is called
  32. end
  33. end
  34.  
  35. end
  36. end)
Advertisement
Add Comment
Please, Sign In to add comment