rrixh

emojiskript

Oct 16th, 2023
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.66 KB | None | 0 0
  1. local emojis = game:GetService("HttpService"):JSONDecode(game:HttpGet("https://raw.githubusercontent.com/Aidez/emojiscopy/master/main", true))
  2. local chatbar = nil
  3. repeat wait() until game.Players.LocalPlayer:FindFirstChild("PlayerGui")
  4. for i,v in pairs(game.Players.LocalPlayer.PlayerGui:GetDescendants()) do
  5.     if v.Name == "ChatBar" then
  6.         chatbar = v
  7.     end
  8. end
  9.  
  10. chatbar:GetPropertyChangedSignal("Text"):Connect(function()
  11.     local reversed = string.reverse(chatbar.Text)
  12.     if string.sub(reversed, 1, 1) == ":" and string.find(reversed, ":", 2) then
  13.         local theend = string.find(reversed, ":", 2)
  14.         local emojiname = string.reverse(string.sub(reversed, 2, theend - 1))
  15.         if emojis[emojiname] ~= nil then
  16.             local message = string.reverse(string.sub(reversed, theend + 1, -1))..emojis[emojiname].." "
  17.             chatbar.Text = message
  18.         end
  19.     end
  20. end)
  21.  
  22. game.Players.LocalPlayer.PlayerGui.DescendantAdded:Connect(function(desc)
  23.     if desc.Name == "ChatBar" then
  24.         chatbar = desc
  25.         chatbar:GetPropertyChangedSignal("Text"):Connect(function()
  26.             local reversed = string.reverse(chatbar.Text)
  27.             if string.sub(reversed, 1, 1) == ":" and string.find(reversed, ":", 2) then
  28.                 local theend = string.find(reversed, ":", 2)
  29.                 local emojiname = string.reverse(string.sub(reversed, 2, theend - 1))
  30.                 if emojis[emojiname] ~= nil then
  31.                     local message = string.reverse(string.sub(reversed, theend + 1, -1))..emojis[emojiname].." "
  32.                     chatbar.Text = message
  33.                 end
  34.             end
  35.         end)
  36.     end
  37. end)
Add Comment
Please, Sign In to add comment