Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.32 KB | None | 0 0
  1. --Edge's Emoji thing...
  2.  
  3. --Similar to how discord does it
  4. --Type : whenever u want to insert an emoji and begin typing the name of it
  5. --Use the up and down arrows and the right shift key to select and insert emojis (or click them)
  6. --This also autocompletes so typing :joy: turns it into that lovely face
  7.  
  8. plrs = game:GetService("Players")
  9. local EmojiGui = Instance.new("ScreenGui")
  10. local PopupFrame = Instance.new("Frame")
  11. local BoxFrame = Instance.new("ScrollingFrame")
  12. local Emoj = Instance.new("TextButton")
  13.  
  14. EmojiGui.Name = "EmojiGui"
  15. EmojiGui.Parent = game.CoreGui
  16.  
  17. PopupFrame.Name = "PopupFrame"
  18. PopupFrame.Parent = EmojiGui
  19. PopupFrame.BackgroundColor3 = Color3.new(1, 1, 1)
  20. PopupFrame.BackgroundTransparency = 0.60000002384186
  21. PopupFrame.BorderColor3 = Color3.new(0, 0, 0)
  22. PopupFrame.Position = UDim2.new(0.5, -160, 0, 0)
  23. PopupFrame.Size = UDim2.new(0, 320, 0, 160)
  24. PopupFrame.ClipsDescendants = true
  25.  
  26. BoxFrame.Name = "BoxFrame"
  27. BoxFrame.Parent = PopupFrame
  28. BoxFrame.BackgroundColor3 = Color3.new(1, 1, 1)
  29. BoxFrame.BackgroundTransparency = 1
  30. BoxFrame.BorderSizePixel = 0
  31. BoxFrame.Position = UDim2.new(0, 7, 0, 7)
  32. BoxFrame.Size = UDim2.new(1, -14, 1, -14)
  33. BoxFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
  34.  
  35. Emoj.Name = "Emoj"
  36. Emoj.Parent = PopupFrame
  37. Emoj.BackgroundColor3 = Color3.new(1, 1, 1)
  38. Emoj.BackgroundTransparency = 1
  39. Emoj.Position = UDim2.new(0, 0, 0.349999994, 0)
  40. Emoj.Size = UDim2.new(0, 40, 0, 40)
  41. Emoj.Visible = false
  42. Emoj.Font = Enum.Font.SourceSans
  43. Emoj.FontSize = Enum.FontSize.Size14
  44. Emoj.Text = "dab"
  45. Emoj.TextScaled = true
  46. Emoj.TextWrapped = true
  47.  
  48. PopupFrame:TweenSize(UDim2.new(0, 320, 0, 0), "InOut", "Quart", 0.5, true, nil)
  49. BoxFrame.CanvasSize = UDim2.new(0,0,0,0)
  50. selected = 0
  51.  
  52. chatbox = plrs.LocalPlayer.PlayerGui.Chat.Frame.ChatBarParentFrame.Frame.BoxFrame.Frame.ChatBar
  53.  
  54. --first one = in game, second one = in studio
  55. local emojil = game:GetService("HttpService"):JSONDecode(game:HttpGet('https://raw.githubusercontent.com/emojione/emojione/master/emoji_strategy.json', true))
  56. --local emojil = game:GetService("HttpService"):JSONDecode(game:GetService("HttpService"):GetAsync('https://raw.githubusercontent.com/emojione/emojione/master/emoji_strategy.json'))
  57. local emotes = {}
  58. local emojis = {}
  59. local unicode = loadstring(game:HttpGet(('https://pastebin.com/raw/ESvakmEn'),true))()
  60. --local unicode = require(workspace.Unicode)
  61. for i,w in next,emojil do
  62. local str = ""
  63. for v in w.unicode_output:gmatch("[%a%d]+") do
  64. str = str..unicode(v)
  65. end
  66. emojis[w.shortname:sub(2,-2)] = {str,w.keywords}
  67. emotes[#emotes + 1] = w.shortname:sub(2,-2)
  68. end
  69.  
  70. local emotes,names = emojis,emotes
  71. shared.emotes = emotes
  72. EmojiGui.Enabled = true
  73. shared.names = names
  74. local chatbar = plrs.LocalPlayer.PlayerGui.Chat.Frame.ChatBarParentFrame.Frame.BoxFrame.Frame.ChatBar
  75.  
  76. function compare(t,v)
  77. for _,i in next,t do
  78. if i:sub(1,#v):lower() == v:lower() then
  79. return true
  80. end
  81. end
  82. end
  83.  
  84. local ret
  85.  
  86. function update(name)
  87. local t = name
  88. local e = {}
  89. if #t ~= 0 then
  90. local n = {}
  91. for i,v in next,emotes do
  92. if i:sub(1,#t):lower() == t:lower() or compare(v[2],t) then
  93. n[#n+1] = i
  94. end
  95. end
  96. table.sort(n,function(a,b)
  97. return a <= b
  98. end)
  99. for i,v in next,n do
  100. e[i] = emotes[v][1]
  101. end
  102. else
  103. for i = 1,1000 do
  104. e[#e+1] = emotes[names[math.random(1,#names)]][1]
  105. end
  106. end
  107. BoxFrame:ClearAllChildren()
  108. local namenum = 1
  109. local prefix = string.find(chatbox.Text,":")
  110. if #e ~= 0 then
  111. PopupFrame:TweenSize(UDim2.new(0, 320, 0, 160), "InOut", "Quart", 0.5, true, nil)
  112. for i,v in next,e do
  113. if i <= 1000 then
  114. local b = Emoj:Clone()
  115. b.Name = tostring(namenum)
  116. b.Visible = true
  117. b.Parent = BoxFrame
  118. b.Text = v
  119. namenum = namenum+1
  120. local x = i%7
  121. if x == 0 then x = 7 end
  122. local y = math.ceil(i/7)
  123. b.Position = UDim2.new(0,x * 40 - 40,0,y * 40 - 40)
  124. b.MouseButton1Click:connect(function()
  125. ret = b.Text
  126. chatbar.Text = chatbar.Text:sub(1,prefix-1)..ret
  127. chatbar:CaptureFocus()
  128. PopupFrame:TweenSize(UDim2.new(0, 320, 0, 0), "InOut", "Quart", 0.5, true, nil)
  129. BoxFrame.CanvasSize = UDim2.new(0,0,0,0)
  130. end)
  131. end
  132. end
  133. else
  134. PopupFrame:TweenSize(UDim2.new(0, 320, 0, 0), "InOut", "Quart", 0.5, true, nil)
  135. end
  136. BoxFrame.CanvasSize = UDim2.new(0,0,0,math.ceil(math.min(#e,250)/7) * 40)
  137. selected = 0
  138. end
  139.  
  140. function updatechat()
  141. chatbox.Changed:connect(function(prpty)
  142. if prpty == 'Text' then
  143. chatbox.Text = string.gsub(chatbox.Text, " ", "")
  144. local prefix = string.find(chatbox.Text,":")
  145. if prefix ~= nil then
  146. local search = chatbox.Text:sub(prefix+1)
  147. if string.find(search," ") then
  148. PopupFrame:TweenSize(UDim2.new(0, 320, 0, 0), "InOut", "Quart", 0.5, true, nil)
  149. BoxFrame.CanvasSize = UDim2.new(0,0,0,0)
  150. return
  151. end
  152. local endsearch = string.find(search,":")
  153. if endsearch ~= nil then
  154. update(search:sub(1,endsearch-1))
  155. PopupFrame:TweenSize(UDim2.new(0, 320, 0, 0), "InOut", "Quart", 0.5, true, nil)
  156. BoxFrame.CanvasSize = UDim2.new(0,0,0,0)
  157. local item = BoxFrame:FindFirstChild('1')
  158. if item ~= nil then
  159. chatbar.Text = chatbar.Text:sub(1,prefix-1)..item.Text
  160. end
  161. return
  162. end
  163. update(search)
  164. else
  165. PopupFrame:TweenSize(UDim2.new(0, 320, 0, 0), "InOut", "Quart", 0.5, true, nil)
  166. BoxFrame.CanvasSize = UDim2.new(0,0,0,0)
  167. end
  168. end
  169. end)
  170. plrs.LocalPlayer.PlayerGui.Chat.Frame.ChatBarParentFrame.ChildAdded:Connect(function(newbar)
  171. wait()
  172. if newbar:FindFirstChild('BoxFrame') then
  173. chatbox = plrs.LocalPlayer.PlayerGui.Chat.Frame.ChatBarParentFrame.Frame.BoxFrame.Frame.ChatBar
  174. updatechat()
  175. end
  176. end)
  177. end
  178. updatechat()
  179.  
  180. game:GetService("UserInputService").InputBegan:connect(function(input)
  181. if input.KeyCode == Enum.KeyCode.Down then
  182. local deselect = BoxFrame:FindFirstChild(tostring(selected))
  183. if deselect ~= nil then
  184. deselect.BackgroundTransparency = 1
  185. end
  186. selected = selected+1
  187. local item = BoxFrame:FindFirstChild(tostring(selected))
  188. if item ~= nil then
  189. item.BackgroundTransparency = 0
  190. else
  191. selected = selected-1
  192. local item = BoxFrame:FindFirstChild(tostring(selected))
  193. if item ~= nil then
  194. item.BackgroundTransparency = 0
  195. end
  196. end
  197. elseif input.KeyCode == Enum.KeyCode.Up then
  198. local deselect = BoxFrame:FindFirstChild(tostring(selected))
  199. if deselect ~= nil then
  200. deselect.BackgroundTransparency = 1
  201. end
  202. selected = selected-1
  203. local item = BoxFrame:FindFirstChild(tostring(selected))
  204. if item ~= nil then
  205. item.BackgroundTransparency = 0
  206. else
  207. selected = selected+1
  208. local item = BoxFrame:FindFirstChild(tostring(selected))
  209. if item ~= nil then
  210. item.BackgroundTransparency = 0
  211. end
  212. end
  213. elseif input.KeyCode == Enum.KeyCode.RightShift then
  214. if selected ~= 0 then
  215. local item = BoxFrame:FindFirstChild(tostring(selected))
  216. local prefix = string.find(chatbox.Text,":")
  217. if item ~= nil and prefix ~= nil then
  218. chatbar.Text = chatbar.Text:sub(1,prefix-1)..item.Text
  219. chatbar:CaptureFocus()
  220. PopupFrame:TweenSize(UDim2.new(0, 320, 0, 0), "InOut", "Quart", 0.5, true, nil)
  221. BoxFrame.CanvasSize = UDim2.new(0,0,0,0)
  222. end
  223. end
  224. end
  225. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement