Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Edge's Emoji thing...
- --Similar to how discord does it
- --Type : whenever u want to insert an emoji and begin typing the name of it
- --Use the up and down arrows and the right shift key to select and insert emojis (or click them)
- --This also autocompletes so typing :joy: turns it into that lovely face
- plrs = game:GetService("Players")
- local EmojiGui = Instance.new("ScreenGui")
- local PopupFrame = Instance.new("Frame")
- local BoxFrame = Instance.new("ScrollingFrame")
- local Emoj = Instance.new("TextButton")
- EmojiGui.Name = "EmojiGui"
- EmojiGui.Parent = game.CoreGui
- PopupFrame.Name = "PopupFrame"
- PopupFrame.Parent = EmojiGui
- PopupFrame.BackgroundColor3 = Color3.new(1, 1, 1)
- PopupFrame.BackgroundTransparency = 0.60000002384186
- PopupFrame.BorderColor3 = Color3.new(0, 0, 0)
- PopupFrame.Position = UDim2.new(0.5, -160, 0, 0)
- PopupFrame.Size = UDim2.new(0, 320, 0, 160)
- PopupFrame.ClipsDescendants = true
- BoxFrame.Name = "BoxFrame"
- BoxFrame.Parent = PopupFrame
- BoxFrame.BackgroundColor3 = Color3.new(1, 1, 1)
- BoxFrame.BackgroundTransparency = 1
- BoxFrame.BorderSizePixel = 0
- BoxFrame.Position = UDim2.new(0, 7, 0, 7)
- BoxFrame.Size = UDim2.new(1, -14, 1, -14)
- BoxFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
- Emoj.Name = "Emoj"
- Emoj.Parent = PopupFrame
- Emoj.BackgroundColor3 = Color3.new(1, 1, 1)
- Emoj.BackgroundTransparency = 1
- Emoj.Position = UDim2.new(0, 0, 0.349999994, 0)
- Emoj.Size = UDim2.new(0, 40, 0, 40)
- Emoj.Visible = false
- Emoj.Font = Enum.Font.SourceSans
- Emoj.FontSize = Enum.FontSize.Size14
- Emoj.Text = "dab"
- Emoj.TextScaled = true
- Emoj.TextWrapped = true
- PopupFrame:TweenSize(UDim2.new(0, 320, 0, 0), "InOut", "Quart", 0.5, true, nil)
- BoxFrame.CanvasSize = UDim2.new(0,0,0,0)
- selected = 0
- chatbox = plrs.LocalPlayer.PlayerGui.Chat.Frame.ChatBarParentFrame.Frame.BoxFrame.Frame.ChatBar
- --first one = in game, second one = in studio
- local emojil = game:GetService("HttpService"):JSONDecode(game:HttpGet('https://raw.githubusercontent.com/emojione/emojione/master/emoji_strategy.json', true))
- --local emojil = game:GetService("HttpService"):JSONDecode(game:GetService("HttpService"):GetAsync('https://raw.githubusercontent.com/emojione/emojione/master/emoji_strategy.json'))
- local emotes = {}
- local emojis = {}
- local unicode = loadstring(game:HttpGet(('https://pastebin.com/raw/ESvakmEn'),true))()
- --local unicode = require(workspace.Unicode)
- for i,w in next,emojil do
- local str = ""
- for v in w.unicode_output:gmatch("[%a%d]+") do
- str = str..unicode(v)
- end
- emojis[w.shortname:sub(2,-2)] = {str,w.keywords}
- emotes[#emotes + 1] = w.shortname:sub(2,-2)
- end
- local emotes,names = emojis,emotes
- shared.emotes = emotes
- EmojiGui.Enabled = true
- shared.names = names
- local chatbar = plrs.LocalPlayer.PlayerGui.Chat.Frame.ChatBarParentFrame.Frame.BoxFrame.Frame.ChatBar
- function compare(t,v)
- for _,i in next,t do
- if i:sub(1,#v):lower() == v:lower() then
- return true
- end
- end
- end
- local ret
- function update(name)
- local t = name
- local e = {}
- if #t ~= 0 then
- local n = {}
- for i,v in next,emotes do
- if i:sub(1,#t):lower() == t:lower() or compare(v[2],t) then
- n[#n+1] = i
- end
- end
- table.sort(n,function(a,b)
- return a <= b
- end)
- for i,v in next,n do
- e[i] = emotes[v][1]
- end
- else
- for i = 1,1000 do
- e[#e+1] = emotes[names[math.random(1,#names)]][1]
- end
- end
- BoxFrame:ClearAllChildren()
- local namenum = 1
- local prefix = string.find(chatbox.Text,":")
- if #e ~= 0 then
- PopupFrame:TweenSize(UDim2.new(0, 320, 0, 160), "InOut", "Quart", 0.5, true, nil)
- for i,v in next,e do
- if i <= 1000 then
- local b = Emoj:Clone()
- b.Name = tostring(namenum)
- b.Visible = true
- b.Parent = BoxFrame
- b.Text = v
- namenum = namenum+1
- local x = i%7
- if x == 0 then x = 7 end
- local y = math.ceil(i/7)
- b.Position = UDim2.new(0,x * 40 - 40,0,y * 40 - 40)
- b.MouseButton1Click:connect(function()
- ret = b.Text
- chatbar.Text = chatbar.Text:sub(1,prefix-1)..ret
- chatbar:CaptureFocus()
- PopupFrame:TweenSize(UDim2.new(0, 320, 0, 0), "InOut", "Quart", 0.5, true, nil)
- BoxFrame.CanvasSize = UDim2.new(0,0,0,0)
- end)
- end
- end
- else
- PopupFrame:TweenSize(UDim2.new(0, 320, 0, 0), "InOut", "Quart", 0.5, true, nil)
- end
- BoxFrame.CanvasSize = UDim2.new(0,0,0,math.ceil(math.min(#e,250)/7) * 40)
- selected = 0
- end
- function updatechat()
- chatbox.Changed:connect(function(prpty)
- if prpty == 'Text' then
- chatbox.Text = string.gsub(chatbox.Text, " ", "")
- local prefix = string.find(chatbox.Text,":")
- if prefix ~= nil then
- local search = chatbox.Text:sub(prefix+1)
- if string.find(search," ") then
- PopupFrame:TweenSize(UDim2.new(0, 320, 0, 0), "InOut", "Quart", 0.5, true, nil)
- BoxFrame.CanvasSize = UDim2.new(0,0,0,0)
- return
- end
- local endsearch = string.find(search,":")
- if endsearch ~= nil then
- update(search:sub(1,endsearch-1))
- PopupFrame:TweenSize(UDim2.new(0, 320, 0, 0), "InOut", "Quart", 0.5, true, nil)
- BoxFrame.CanvasSize = UDim2.new(0,0,0,0)
- local item = BoxFrame:FindFirstChild('1')
- if item ~= nil then
- chatbar.Text = chatbar.Text:sub(1,prefix-1)..item.Text
- end
- return
- end
- update(search)
- else
- PopupFrame:TweenSize(UDim2.new(0, 320, 0, 0), "InOut", "Quart", 0.5, true, nil)
- BoxFrame.CanvasSize = UDim2.new(0,0,0,0)
- end
- end
- end)
- plrs.LocalPlayer.PlayerGui.Chat.Frame.ChatBarParentFrame.ChildAdded:Connect(function(newbar)
- wait()
- if newbar:FindFirstChild('BoxFrame') then
- chatbox = plrs.LocalPlayer.PlayerGui.Chat.Frame.ChatBarParentFrame.Frame.BoxFrame.Frame.ChatBar
- updatechat()
- end
- end)
- end
- updatechat()
- game:GetService("UserInputService").InputBegan:connect(function(input)
- if input.KeyCode == Enum.KeyCode.Down then
- local deselect = BoxFrame:FindFirstChild(tostring(selected))
- if deselect ~= nil then
- deselect.BackgroundTransparency = 1
- end
- selected = selected+1
- local item = BoxFrame:FindFirstChild(tostring(selected))
- if item ~= nil then
- item.BackgroundTransparency = 0
- else
- selected = selected-1
- local item = BoxFrame:FindFirstChild(tostring(selected))
- if item ~= nil then
- item.BackgroundTransparency = 0
- end
- end
- elseif input.KeyCode == Enum.KeyCode.Up then
- local deselect = BoxFrame:FindFirstChild(tostring(selected))
- if deselect ~= nil then
- deselect.BackgroundTransparency = 1
- end
- selected = selected-1
- local item = BoxFrame:FindFirstChild(tostring(selected))
- if item ~= nil then
- item.BackgroundTransparency = 0
- else
- selected = selected+1
- local item = BoxFrame:FindFirstChild(tostring(selected))
- if item ~= nil then
- item.BackgroundTransparency = 0
- end
- end
- elseif input.KeyCode == Enum.KeyCode.RightShift then
- if selected ~= 0 then
- local item = BoxFrame:FindFirstChild(tostring(selected))
- local prefix = string.find(chatbox.Text,":")
- if item ~= nil and prefix ~= nil then
- chatbar.Text = chatbar.Text:sub(1,prefix-1)..item.Text
- chatbar:CaptureFocus()
- PopupFrame:TweenSize(UDim2.new(0, 320, 0, 0), "InOut", "Quart", 0.5, true, nil)
- BoxFrame.CanvasSize = UDim2.new(0,0,0,0)
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement