Advertisement
Free-Scripts

ROBLOX Chat Bot (A.I)

Mar 28th, 2022
11,025
1
Never
3
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 1 0
  1. local HttpService = game:GetService("HttpService")
  2. local Players = game:GetService("Players")
  3.  
  4. _G.Owner = "ur name here lol"
  5.  
  6. function getChat(message,plrname)
  7.  
  8.    local Split = message:gsub(" ", "+") -- This takes spaces within the person's message and turns it into for ex: Hi+How+Are+You... to ensure that there are no errors and to also make the URL work
  9.    
  10.    local Response = game:HttpGet("https://api.affiliateplus.xyz/api/chatbot?message=" .. Split .. "&botname=" .. plrname .. "&ownername=" .. _G.Owner .. "&user=1")
  11.    local Data = HttpService:JSONDecode(Response)
  12.    wait(1)
  13.    game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest:FireServer(Data.message, "All")
  14. end
  15.  
  16. Players.PlayerChatted:Connect(function(type, plr, message)
  17.    if plr.Name ~= Players.LocalPlayer.Name then
  18.        getChat(message, plr.Name)
  19.    end
  20. end)
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement