-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathEmotes
More file actions
63 lines (61 loc) · 2.2 KB
/
Copy pathEmotes
File metadata and controls
63 lines (61 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
--This is not a really important thing for you to scam it, ok? little skid.
local HttpService = game:GetService("HttpService")
return {
LoadEmotes = function(Emotes, LoadedEmotes)
local Success, Result = pcall(function()
return game:HttpGet("https://raw.githubusercontent.com/DRYF-1/Roblox-Emote/refs/heads/main/EmoteSniper.json")
end)
if not Success or not Result then return end
local Ok, Data = pcall(function() return HttpService:JSONDecode(Result) end)
if not Ok or type(Data) ~= "table" then return end
if Data.data then Data = Data.data elseif Data.Emotes then Data = Data.Emotes end
local function AddEmote(Name, Id)
if not (Name and Id) then return end
Id = tonumber(Id)
if not Id then return end
if LoadedEmotes[Id] then return end
LoadedEmotes[Id] = true
Name = tostring(Name)
table.insert(Emotes, {
name = Name,
lowerName = string.lower(Name),
id = Id,
icon = "rbxthumb://type=Asset&id=" .. tostring(Id) .. "&w=150&h=150",
lastupdated = os.time(),
})
end
for _, Emote in pairs(Data) do
if type(Emote) == "table" then
local Name = Emote.Name or Emote.name
local Id = Emote.Id or Emote.id or Emote.AssetId
if Name and Id then AddEmote(Name, Id) end
end
end
AddEmote("Arm Wave", 5915773155)
AddEmote("Head Banging", 5915779725)
AddEmote("Face Calisthenics", 9830731012)
end,
SortEmotes = function(DisplayEmotes, FavSet, CurrentSort)
table.sort(DisplayEmotes, function(a, b)
local Af, Bf = FavSet[a.id] == true, FavSet[b.id] == true
if Af ~= Bf then return Af and not Bf end
if CurrentSort == "recentfirst" then return (a.lastupdated or 0) > (b.lastupdated or 0)
elseif CurrentSort == "recentlast" then return (a.lastupdated or 0) < (b.lastupdated or 0)
elseif CurrentSort == "alphabeticfirst" then return a.lowerName < b.lowerName
elseif CurrentSort == "alphabeticlast" then return a.lowerName > b.lowerName
end
return a.lowerName < b.lowerName
end)
end,
FilterEmotes = function(Emotes, Q)
if Q == "" then return Emotes end
local NewList = table.create(256)
for i = 1, #Emotes do
local E = Emotes[i]
if E.lowerName:find(Q, 1, true) then
NewList[#NewList + 1] = E
end
end
return NewList
end
}