local WindUI
do
local ok, result = pcall(function()
return require("./src/Init")
end)
if ok then
WindUI = result
else
WindUI = loadstring(game:HttpGet("https://github.com/Footagesus/WindUI/releases/latest/download/main.lua"))()
end
end
WindUI.TransparencyValue = 0.2
WindUI:SetTheme("Dark")
local Window = WindUI:CreateWindow({
Title = "Visual Emote Changer",
Author = "By Pnsdg (Evade Overhaul)",
Folder = "DaraHub",
Size = UDim2.fromOffset(580, 490),
Theme = "Dark",
HidePanelBackground = false,
Acrylic = false,
HideSearchBar = false,
SideBarWidth = 200
})
Window:SetIconSize(48)
Window:CreateTopbarButton("theme-switcher", "moon", function()
WindUI:SetTheme(WindUI:GetCurrentTheme() == "Dark" and "Light" or "Dark")
end, 990)
local FeatureSection = Window:Section({ Title = "Idk", Opened = true })
local Tabs = {
EmoteChanger = FeatureSection:Tab({ Title = "EmoteChanger", Icon = "smile" })
}
Tabs.EmoteChanger:Section({ Title = "Overhaul remote function hooks"})
local player = game:GetService("Players").LocalPlayer
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Events = ReplicatedStorage:WaitForChild("Events", 10)
local CharacterFolder = Events and Events:WaitForChild("Character", 10)
local EmoteRemote = CharacterFolder and CharacterFolder:WaitForChild("Emote", 10)
local PassCharacterInfo = CharacterFolder and CharacterFolder:WaitForChild("PassCharacterInfo", 10)
local remoteSignal = PassCharacterInfo and PassCharacterInfo.OnClientEvent
local currentTag = nil
local currentEmotes = table.create(12, "")
local selectEmotes = table.create(12, "")
local emoteEnabled = table.create(12, false)
local currentEmoteInputs = {}
local selectEmoteInputs = {}
local function readTagFromFolder(f)
if not f then return nil end
local a = f:GetAttribute("Tag")
if a ~= nil then
return a
end
local o = f:FindFirstChild("Tag")
if o and o:IsA("ValueBase") then
return o.Value
end
return nil
end
local function onRespawn()
currentTag = nil
pendingSlot = nil
task.spawn(function()
local startTime = tick()
while tick() - startTime < 10 do
if workspace:FindFirstChild("Game") and workspace.Game:FindFirstChild("Players") then
local pf = workspace.Game.Players:FindFirstChild(player.Name)
if pf then
currentTag = readTagFromFolder(pf)
if currentTag then
local b = tonumber(currentTag)
if b and b >= 0 and b <= 255 then
break
else
currentTag = nil
end
end
end
end
task.wait(0.5)
end
end)
end
local pendingSlot = nil
local blockOriginalEmote = false
local function fireSelect(slot)
if not currentTag then return end
local b = tonumber(currentTag)
if not b or b < 0 or b > 255 then return end
if not selectEmotes[slot] or selectEmotes[slot] == "" then return end
local buf = buffer.create(2)
buffer.writeu8(buf, 0, b)
buffer.writeu8(buf, 1, 17)
if remoteSignal then
firesignal(remoteSignal, buf, {selectEmotes[slot]})
end
end
if PassCharacterInfo and EmoteRemote then
PassCharacterInfo.OnClientEvent:Connect(function(...)
if not pendingSlot then return end
local slot = pendingSlot
pendingSlot = nil
task.wait(0.1)
fireSelect(slot)
end)
local success, oldNamecall = pcall(function()
return hookmetamethod(game, "__namecall", function(self, ...)
local m
local ok, err = pcall(function()
m = getnamecallmethod()
end)
if not ok then return nil end
local args = {...}
if m == "FireServer" and self == EmoteRemote and type(args[1]) == "string" then
for i = 1, 12 do
if emoteEnabled[i] and currentEmotes[i] ~= "" and args[1] == currentEmotes[i] then
pendingSlot = i
blockOriginalEmote = true
task.spawn(function()
local ok2, err2 = pcall(function()
task.wait(0.1)
blockOriginalEmote = false
if pendingSlot == i then
pendingSlot = nil
fireSelect(i)
end
end)
if not ok2 then warn(err2) end
end)
if blockOriginalEmote then
return nil
end
end
end
end
return oldNamecall(self, ...)
end)
end)
if not success then
if EmoteChangerEmoteApply then
EmoteChangerEmoteApply:Lock()
end
if EmoteChangerEmoteReset then
EmoteChangerEmoteReset:Lock()
end
for i = 1, 12 do
if currentEmoteInputs[i] and currentEmoteInputs[i].Lock then
currentEmoteInputs[i]:Lock()
end
if selectEmoteInputs[i] and selectEmoteInputs[i].Lock then
selectEmoteInputs[i]:Lock()
end
end
WindUI:Notify({
Title = "Executor Incompatible",
Content = "Your executor is not supported. Some features have been disabled.",
Duration = 5
})
end
if player.Character then
task.spawn(onRespawn)
end
player.CharacterAdded:Connect(function()
task.wait(1)
onRespawn()
end)
if workspace:FindFirstChild("Game") and workspace.Game:FindFirstChild("Players") then
workspace.Game.Players.ChildAdded:Connect(function(child)
if child.Name == player.Name then
task.wait(0.5)
onRespawn()
end
end)
workspace.Game.Players.ChildRemoved:Connect(function(child)
if child.Name == player.Name then
currentTag = nil
pendingSlot = nil
end
end)
end
end
Tabs.EmoteChanger:Section({ Title = "Emote Changer", TextSize = 20 })
Tabs.EmoteChanger:Divider()
for i = 1, 12 do
currentEmoteInputs[i] = Tabs.EmoteChanger:Input({
Title = "Current Emote " .. i,
Placeholder = "Enter current emote name",
Value = currentEmotes[i],
Callback = function(v)
currentEmotes[i] = v:gsub("%s+", "")
end
})
end
Tabs.EmoteChanger:Divider()
for i = 1, 12 do
selectEmoteInputs[i] = Tabs.EmoteChanger:Input({
Title = "Select Emote " .. i,
Placeholder = "Enter select emote name",
Value = selectEmotes[i],
Callback = function(v)
selectEmotes[i] = v:gsub("%s+", "")
end
})
end
EmoteChangerEmoteOption = Tabs.EmoteChanger:Input({
Title = "Emote Possible option",
Desc = "Higher Value may Broke emote animation recommend Use 1-3",
Placeholder = "1",
Callback = function(v)
local num = tonumber(v) or 1
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local currentNum = num
local function setupCharacter(character)
if character == player.Character then
character:SetAttribute("EmoteNum", currentNum)
end
end
local function monitorCharacter()
while true do
wait(1)
local character = player.Character
if character and character:GetAttribute("EmoteNum") ~= currentNum then
character:SetAttribute("EmoteNum", currentNum)
end
end
end
if player.Character then
setupCharacter(player.Character)
end
player.CharacterAdded:Connect(function(character)
wait(1)
setupCharacter(character)
end)
spawn(monitorCharacter)
end
})
EmoteChangerEmoteApply = Tabs.EmoteChanger:Button({
Title="Apply Emote Mappings",
Icon="check",
Callback=function()
local hasAnyEmote = false
for i=1,12 do
if currentEmotes[i] ~= "" or selectEmotes[i] ~= "" then
hasAnyEmote = true
break
end
end
if not hasAnyEmote then
WindUI:Notify({
Title="Emote Changer",
Content="Please enter your emote",
Duration=3
})
return
end
local function normalizeEmoteName(name)
return name:gsub("%s+", ""):lower()
end
local function isValidEmote(emoteName)
if emoteName == "" then return false, "" end
local normalizedInput = normalizeEmoteName(emoteName)
local emotesFolder = game:GetService("ReplicatedStorage"):FindFirstChild("Items")
if emotesFolder then
emotesFolder = emotesFolder:FindFirstChild("Emotes")
if emotesFolder then
for _, emoteModule in ipairs(emotesFolder:GetChildren()) do
if emoteModule:IsA("ModuleScript") then
local normalizedEmote = normalizeEmoteName(emoteModule.Name)
if normalizedEmote == normalizedInput then
return true, emoteModule.Name
end
end
end
end
end
return false, ""
end
local sameEmoteSlots = {}
local missingEmoteSlots = {}
local invalidEmoteSlots = {}
local successfulSlots = {}
for i=1,12 do
if currentEmotes[i] ~= "" and selectEmotes[i] ~= "" then
local currentValid, currentActual = isValidEmote(currentEmotes[i])
local selectValid, selectActual = isValidEmote(selectEmotes[i])
if not currentValid and not selectValid then
table.insert(invalidEmoteSlots, {slot = i, currentInvalid = true, currentName = currentEmotes[i], selectInvalid = true, selectName = selectEmotes[i]})
elseif not currentValid then
table.insert(invalidEmoteSlots, {slot = i, currentInvalid = true, currentName = currentEmotes[i], selectInvalid = false, selectName = selectEmotes[i]})
elseif not selectValid then
table.insert(invalidEmoteSlots, {slot = i, currentInvalid = false, currentName = currentEmotes[i], selectInvalid = true, selectName = selectEmotes[i]})
elseif currentActual:lower() == selectActual:lower() then
table.insert(sameEmoteSlots, i)
else
table.insert(successfulSlots, {slot = i, current = currentActual, select = selectActual})
end
elseif currentEmotes[i] ~= "" or selectEmotes[i] ~= "" then
table.insert(missingEmoteSlots, i)
end
end
local message = ""
if #successfulSlots > 0 then
message = message .. "✓ Successfully applied emote on:\n"
for _, data in ipairs(successfulSlots) do
message = message .. "Slot " .. data.slot .. " Emote: " .. data.current .. " → " .. data.select .. "\n"
end
message = message .. "\n"
end
if #sameEmoteSlots > 0 then
message = message .. "⚠️ Failed to apply emote on:\n"
for _, slot in ipairs(sameEmoteSlots) do
message = message .. "Slot " .. slot .. " - Cannot change emote with the same name\n"
end
message = message .. "\n"
end
if #invalidEmoteSlots > 0 then
message = message .. "⚠️ Failed to apply emote on:\n"
for _, data in ipairs(invalidEmoteSlots) do
message = message .. "Slot " .. data.slot .. " - "
if data.currentInvalid and data.selectInvalid then
message = message .. "Invalid current emote: \"" .. data.currentName .. "\", Invalid select emote: \"" .. data.selectName .. "\"\n"
elseif data.currentInvalid then
message = message .. "Invalid current emote: \"" .. data.currentName .. "\", Select emote: \"" .. data.selectName .. "\"\n"
else
message = message .. "Current emote: \"" .. data.currentName .. "\", Invalid select emote: \"" .. data.selectName .. "\"\n"
end
end
message = message .. "\n"
end
if #missingEmoteSlots > 0 then
message = message .. "⚠️ Failed to apply emote on:\n"
for _, slot in ipairs(missingEmoteSlots) do
if currentEmotes[slot] == "" then
message = message .. "Slot " .. slot .. " - Current emote slot is missing text\n"
else
message = message .. "Slot " .. slot .. " - Select emote slot is missing text\n"
end
end
end
for i=1,12 do
local currentValid = isValidEmote(currentEmotes[i])
local selectValid = isValidEmote(selectEmotes[i])
emoteEnabled[i] = (currentValid and selectValid and currentEmotes[i]:lower() ~= selectEmotes[i]:lower())
end
WindUI:Notify({
Title="Emote Changer",
Content=message,
Duration=8
})
end
})
EmoteChangerEmoteReset = Tabs.EmoteChanger:Button({
Title = "Reset All Emotes",
Icon = "trash-2",
Callback = function()
for i = 1, 12 do
currentEmotes[i] = ""
selectEmotes[i] = ""
emoteEnabled[i] = false
if currentEmoteInputs[i] and currentEmoteInputs[i].Set then
currentEmoteInputs[i]:Set("")
end
if selectEmoteInputs[i] and selectEmoteInputs[i].Set then
selectEmoteInputs[i]:Set("")
end
end
WindUI:Notify({
Title = "Emote Changer",
Content = "All emotes have been reset!"
})
end
})
Tabs.EmoteChanger:Section({ Title = "Legacy remote function hooks"})
yaneedtobeinlegacymodetousethis = Tabs.EmoteChanger:Paragraph({ Title = "ya need to be in legacy mode to use this"})
local placeId = game.PlaceId
if placeId == 96537472072550 then
if yaneedtobeinlegacymodetousethis then
yaneedtobeinlegacymodetousethis:Lock()
end
if EmoteChangerEmoteApply then
EmoteChangerEmoteApply:Lock()
end
if EmoteChangerEmoteReset then
EmoteChangerEmoteReset:Lock()
end
for i = 1, 12 do
if currentEmoteInputs[i] and currentEmoteInputs[i].Lock then
currentEmoteInputs[i]:Lock()
end
if selectEmoteInputs[i] and selectEmoteInputs[i].Lock then
selectEmoteInputs[i]:Lock()
end
end
originalEmotes = {}
for i = 1, 8 do
originalEmotes[i] = game:GetService("Players").LocalPlayer:GetAttribute("Emote" .. i) or ""
end
hookInstalled = false
blockRemote = false
emoteSpeedConnection = nil
tpcameraConnection = nil
emotingAttributeConnection = nil
pendingEmoteChanges = {}
emoteSpeedCache = {}
function GetPlayerTagData()
local player = game:GetService("Players").LocalPlayer
local character = player.Character
if character then
return character:GetAttribute("Tag")
end
return nil
end
function TriggerTagEmote(emoteSlot)
if not blockRemote then return end
local emoteName = pendingEmoteChanges[emoteSlot] or game:GetService("Players").LocalPlayer:GetAttribute("Emote" .. emoteSlot)
if not emoteName or emoteName == "" then return end
local tagData = GetPlayerTagData()
if not tagData then return end
local characterEvent = game:GetService("ReplicatedStorage").Events.Character.Emote
firesignal(characterEvent.OnClientEvent, tagData, emoteName)
end
function GetEmoteSpeedFromModule(emoteName)
if emoteSpeedCache[emoteName] then
return emoteSpeedCache[emoteName]
end
local replicatedStorage = game:GetService("ReplicatedStorage")
if not replicatedStorage then return 1 end
local itemsFolder = replicatedStorage:FindFirstChild("Items")
if not itemsFolder then return 1 end
local emotesFolder = itemsFolder:FindFirstChild("Emotes")
if not emotesFolder then return 1 end
local emoteModule = emotesFolder:FindFirstChild(emoteName)
if not emoteModule or not emoteModule:IsA("ModuleScript") then return 1 end
local success, emoteData = pcall(require, emoteModule)
if not success or not emoteData then return 1 end
local speedMult = emoteData.SpeedMult or emoteData.EmoteInfo and emoteData.EmoteInfo.SpeedMult or 1
emoteSpeedCache[emoteName] = speedMult
return speedMult
end
function SetupEmoteSpeedChange(apply)
if emoteSpeedConnection then
emoteSpeedConnection:Disconnect()
emoteSpeedConnection = nil
end
local playerModel = workspace:FindFirstChild("Game") and workspace.Game:FindFirstChild("Players")
if playerModel then
local localPlayerModel = playerModel:FindFirstChild(game.Players.LocalPlayer.Name)
if localPlayerModel then
local isEmoting = localPlayerModel:GetAttribute("Emoting")
if isEmoting == true then
local emoteName = nil
for i = 1, 8 do
local currentEmote = game:GetService("Players").LocalPlayer:GetAttribute("Emote" .. i)
if currentEmote and currentEmote ~= "" then
emoteName = currentEmote
break
end
end
if emoteName then
local speedMult = GetEmoteSpeedFromModule(emoteName)
local statChanges = localPlayerModel:FindFirstChild("StatChanges")
if statChanges then
local speed = statChanges:FindFirstChild("Speed")
if speed then
local emoteSpeed = speed:FindFirstChild("EmoteSpeed")
if apply then
if emoteSpeed then
emoteSpeed.Value = speedMult
else
emoteSpeed = Instance.new("NumberValue")
emoteSpeed.Name = "EmoteSpeed"
emoteSpeed.Value = speedMult
emoteSpeed.Parent = speed
end
else
if emoteSpeed then
emoteSpeed:Destroy()
end
end
end
end
end
else
local statChanges = localPlayerModel:FindFirstChild("StatChanges")
if statChanges then
local speed = statChanges:FindFirstChild("Speed")
if speed then
local emoteSpeed = speed:FindFirstChild("EmoteSpeed")
if emoteSpeed then
emoteSpeed:Destroy()
end
end
end
end
if apply then
emoteSpeedConnection = localPlayerModel:GetAttributeChangedSignal("Emoting"):Connect(function()
local newIsEmoting = localPlayerModel:GetAttribute("Emoting")
local statChanges = localPlayerModel:FindFirstChild("StatChanges")
if statChanges then
local speed = statChanges:FindFirstChild("Speed")
if speed then
local emoteSpeed = speed:FindFirstChild("EmoteSpeed")
if newIsEmoting == true then
local emoteName = nil
for i = 1, 8 do
local currentEmote = game:GetService("Players").LocalPlayer:GetAttribute("Emote" .. i)
if currentEmote and currentEmote ~= "" then
emoteName = currentEmote
break
end
end
if emoteName then
local speedMult = GetEmoteSpeedFromModule(emoteName)
if not emoteSpeed then
emoteSpeed = Instance.new("NumberValue")
emoteSpeed.Name = "EmoteSpeed"
emoteSpeed.Value = speedMult
emoteSpeed.Parent = speed
else
emoteSpeed.Value = speedMult
end
end
else
if emoteSpeed then
emoteSpeed:Destroy()
end
end
end
end
end)
end
end
end
end
function SetupTPCameraOnEmoting(apply)
if tpcameraConnection then
tpcameraConnection:Disconnect()
tpcameraConnection = nil
end
if emotingAttributeConnection then
emotingAttributeConnection:Disconnect()
emotingAttributeConnection = nil
end
if apply then
local playerModel = workspace:FindFirstChild("Game") and workspace.Game:FindFirstChild("Players")
if playerModel then
local localPlayerModel = playerModel:FindFirstChild(game.Players.LocalPlayer.Name)
if localPlayerModel then
emotingAttributeConnection = localPlayerModel:GetAttributeChangedSignal("Emoting"):Connect(function()
local isEmoting = localPlayerModel:GetAttribute("Emoting")
if isEmoting == true then
local Event = game:GetService("Players").LocalPlayer.Character.Client
firesignal(Event.OnClientEvent, "TPCamera", {Zoom = 10})
end
end)
end
end
end
end
function InstallHook()
local Event = game:GetService("ReplicatedStorage").Events.Emote
if hookInstalled then return end
local success, errorMsg = pcall(function()
local mt = getrawmetatable(Event)
if mt and mt.__namecall then
local oldNamecall = mt.__namecall
setreadonly(mt, false)
mt.__namecall = function(self, ...)
local method = getnamecallmethod()
if method == "FireServer" then
local args = {...}
local emoteNum = tostring(args[1])
if blockRemote and emoteNum:match("^[1-8]$") then
TriggerTagEmote(tonumber(emoteNum))
return
end
end
return oldNamecall(self, ...)
end
setreadonly(mt, true)
hookInstalled = true
WindUI:Notify({
Title = "Hook Status",
Content = "Emote hook installed successfully",
Duration = 3
})
else
WindUI:Notify({
Title = "Hook Status",
Content = "Could not get metatable, using fallback",
Duration = 3
})
end
end)
if not success then
WindUI:Notify({
Title = "Hook Error",
Content = "Failed to install hook: " .. tostring(errorMsg),
Duration = 3
})
end
if not hookInstalled then
WindUI:Notify({
Title = "Hook Status",
Content = "Using fallback method",
Duration = 3
})
end
end
function ScanReplicatedStorageEmotes()
emotes = {}
replicatedStorage = game:GetService("ReplicatedStorage")
if replicatedStorage then
itemsFolder = replicatedStorage:FindFirstChild("Items")
if itemsFolder then
emotesFolder = itemsFolder:FindFirstChild("Emotes")
if emotesFolder then
for _, item in pairs(emotesFolder:GetChildren()) do
table.insert(emotes, item.Name)
end
end
end
end
return #emotes > 0 and emotes or {"No emotes found"}
end
emoteValues = ScanReplicatedStorageEmotes()
legacyemoteDropdowns = {}
for i = 1, 8 do
currentEmote = game:GetService("Players").LocalPlayer:GetAttribute("Emote" .. i) or ""
legacyemoteDropdowns[i] = Tabs.EmoteChanger:Dropdown({
Title = "Emote Slot " .. i,
Flag = "EmoteSlot" .. i,
Desc = "Current: " .. currentEmote,
Values = emoteValues,
Value = currentEmote,
Multi = false,
AllowNone = true,
Callback = function(value)
pendingEmoteChanges[i] = value
legacyemoteDropdowns[i].Desc = "Pending: " .. (value or "Not set")
end
})
end
Tabs.EmoteChanger:Space()
LegacyApply = Tabs.EmoteChanger:Button({
Title = "Apply All Emotes",
Desc = "Apply current emote settings",
Callback = function()
blockRemote = true
local success, errorMsg = pcall(function()
for i = 1, 8 do
if pendingEmoteChanges[i] then
game:GetService("Players").LocalPlayer:SetAttribute("Emote" .. i, pendingEmoteChanges[i])
legacyemoteDropdowns[i].Desc = "Applied: " .. (pendingEmoteChanges[i] or "Not set")
end
end
pendingEmoteChanges = {}
SetupEmoteSpeedChange(true)
SetupTPCameraOnEmoting(true)
InstallHook()
end)
if success then
WindUI:Notify({
Title = "Emotes Applied",
Content = "Custom emotes are now active",
Duration = 3
})
else
WindUI:Notify({
Title = "Apply Error",
Content = "Failed to apply emotes: " .. tostring(errorMsg),
Duration = 3
})
end
end
})
LegacyReset = Tabs.EmoteChanger:Button({
Title = "Reset All Emotes",
Desc = "Restore original emote state",
Callback = function()
blockRemote = false
local success, errorMsg = pcall(function()
SetupEmoteSpeedChange(false)
SetupTPCameraOnEmoting(false)
pendingEmoteChanges = {}
for i = 1, 8 do
game:GetService("Players").LocalPlayer:SetAttribute("Emote" .. i, originalEmotes[i])
legacyemoteDropdowns[i]:Set(originalEmotes[i])
legacyemoteDropdowns[i].Desc = "Current: " .. (originalEmotes[i] or "Not set")
end
end)
if success then
WindUI:Notify({
Title = "Emotes Reset",
Content = "All emotes restored to original",
Duration = 3
})
else
WindUI:Notify({
Title = "Reset Error",
Content = "Failed to reset emotes: " .. tostring(errorMsg),
Duration = 3
})
end
end
})
game:GetService("Players").LocalPlayer.CharacterAdded:Connect(function()
task.wait(1)
if blockRemote then
local success = pcall(function()
SetupEmoteSpeedChange(true)
SetupTPCameraOnEmoting(true)
end)
end
end)
if game:GetService("Players").LocalPlayer.Character then
if blockRemote then
task.wait(1)
local success = pcall(function()
SetupEmoteSpeedChange(true)
SetupTPCameraOnEmoting(true)
end)
end
end
InstallHook()
end
Tabs.EmoteChanger:Section({ Title = "Swapping mode (Global)"})
Tabs.EmoteChanger:Section({ Title = "What's different of emote Swapper and emote changer? well it's different because emote swap is gonna sawp emote from ReplicatedStorage and emote changer is gonna fetch what emote you executed from remote spy, this may not working on shitty executeor", TextSize = 10 })
Tabs.EmoteChanger:Divider()
EmoteSwapper = {
CurrentEmotes = {},
SelectedEmotes = {},
SwappedPairs = {},
InputFields = {},
PendingApply = false,
PendingSwaps = {}
}
for i = 1, 12 do
EmoteSwapper.CurrentEmotes[i] = ""
EmoteSwapper.SelectedEmotes[i] = ""
end
Tabs.EmoteChanger:Section({ Title = "Current Emotes", TextSize = 16 })
for i = 1, 12 do
EmoteSwapper.InputFields["CurrentEmote" .. i] = Tabs.EmoteChanger:Input({
Title = "Current Emote " .. i,
Placeholder = "Enter current emote name",
Value = "",
Callback = function(value)
EmoteSwapper.CurrentEmotes[i] = value
end
})
end
Tabs.EmoteChanger:Section({ Title = "Selected Emotes", TextSize = 16 })
for i = 1, 12 do
EmoteSwapper.InputFields["SelectedEmote" .. i] = Tabs.EmoteChanger:Input({
Title = "Select Emote " .. i,
Placeholder = "Enter replacement emote name",
Value = "",
Callback = function(value)
EmoteSwapper.SelectedEmotes[i] = value
end
})
end
function SwapEmoteNames(currentName, selectedName)
Items = game:GetService("ReplicatedStorage"):FindFirstChild("Items")
if not Items then return false end
EmotesFolder = Items:FindFirstChild("Emotes")
if not EmotesFolder then return false end
currentEmoteObj = EmotesFolder:FindFirstChild(currentName)
selectedEmoteObj = EmotesFolder:FindFirstChild(selectedName)
if currentEmoteObj and selectedEmoteObj then
tempName = selectedName .. "_EmoteSwapTemp"
while EmotesFolder:FindFirstChild(tempName) do
tempName = tempName .. "_"
end
currentEmoteObj.Name = tempName
selectedEmoteObj.Name = currentName
currentEmoteObj.Name = selectedName
return true
end
return false
end
function ResetEmoteNames()
Items = game:GetService("ReplicatedStorage"):FindFirstChild("Items")
if not Items then return false end
EmotesFolder = Items:FindFirstChild("Emotes")
if not EmotesFolder then return false end
for currentEmote, selectedEmote in pairs(EmoteSwapper.SwappedPairs) do
currentEmoteObj = EmotesFolder:FindFirstChild(selectedEmote)
selectedEmoteObj = EmotesFolder:FindFirstChild(currentEmote)
if currentEmoteObj and selectedEmoteObj then
tempName = currentEmote .. "_EmoteSwapTemp"
while EmotesFolder:FindFirstChild(tempName) do
tempName = tempName .. "_"
end
currentEmoteObj.Name = tempName
selectedEmoteObj.Name = selectedEmote
currentEmoteObj.Name = currentEmote
end
end
return true
end
function ProcessPendingSwaps()
if not EmoteSwapper.PendingSwaps or #EmoteSwapper.PendingSwaps == 0 then
return
end
swappedCount = 0
failedCount = 0
for _, swapData in ipairs(EmoteSwapper.PendingSwaps) do
currentEmote = swapData[1]
selectedEmote = swapData[2]
if SwapEmoteNames(currentEmote, selectedEmote) then
EmoteSwapper.SwappedPairs[currentEmote] = selectedEmote
swappedCount = swappedCount + 1
else
failedCount = failedCount + 1
end
end
EmoteSwapper.PendingSwaps = {}
EmoteSwapper.PendingApply = false
return swappedCount, failedCount
end
function CheckIfPlayerDead()
return not player.Character or not player.Character:FindFirstChild("Humanoid") or player.Character.Humanoid.Health <= 0
end
function CheckIfPlayerDowned()
return player.Character and player.Character:GetAttribute("Downed")
end
EmoteSwapApplyButton = Tabs.EmoteChanger:Button({
Title = "Apply Emote Swap",
Desc = "Swap the current emotes with selected ones",
Icon = "refresh-cw",
Callback = function()
if CheckIfPlayerDead() and not CheckIfPlayerDowned() then
EmoteSwapper.PendingSwaps = {}
for i = 1, 12 do
currentEmote = EmoteSwapper.CurrentEmotes[i]
selectedEmote = EmoteSwapper.SelectedEmotes[i]
if currentEmote ~= "" and selectedEmote ~= "" then
table.insert(EmoteSwapper.PendingSwaps, {currentEmote, selectedEmote})
end
end
if #EmoteSwapper.PendingSwaps > 0 then
EmoteSwapper.PendingApply = true
WindUI:Notify({
Title = "Emote Swapper",
Content = "Player is dead. Emote swap will be applied when you respawn.",
Icon = "clock",
Duration = 3
})
else
WindUI:Notify({
Title = "Emote Swapper",
Content = "No emotes specified to swap",
Icon = "x-circle",
Duration = 3
})
end
return
end
swappedCount = 0
failedCount = 0
for i = 1, 12 do
currentEmote = EmoteSwapper.CurrentEmotes[i]
selectedEmote = EmoteSwapper.SelectedEmotes[i]
if currentEmote ~= "" and selectedEmote ~= "" then
if SwapEmoteNames(currentEmote, selectedEmote) then
EmoteSwapper.SwappedPairs[currentEmote] = selectedEmote
swappedCount = swappedCount + 1
else
failedCount = failedCount + 1
end
end
end
message = ""
if swappedCount > 0 then
message = "Successfully swapped " .. tostring(swappedCount) .. " emote(s)"
end
if failedCount > 0 then
if message ~= "" then message = message .. " | " end
message = message .. "Failed to swap " .. tostring(failedCount) .. " emote(s)"
end
if message == "" then
message = "No emotes specified to swap"
end
WindUI:Notify({
Title = "Emote Swapper",
Content = message,
Icon = swappedCount > 0 and "check-circle" or "x-circle",
Duration = 3
})
end
})
EmoteSwapResetButton = Tabs.EmoteChanger:Button({
Title = "Reset Emote Module",
Desc = "Restore all emotes to their original names",
Icon = "rotate-ccw",
Callback = function()
if ResetEmoteNames() then
EmoteSwapper.SwappedPairs = {}
EmoteSwapper.PendingSwaps = {}
EmoteSwapper.PendingApply = false
for i = 1, 12 do
EmoteSwapper.CurrentEmotes[i] = ""
EmoteSwapper.SelectedEmotes[i] = ""
if EmoteSwapper.InputFields["CurrentEmote" .. i] then
EmoteSwapper.InputFields["CurrentEmote" .. i]:Set("")
end
if EmoteSwapper.InputFields["SelectedEmote" .. i] then
EmoteSwapper.InputFields["SelectedEmote" .. i]:Set("")
end
end
WindUI:Notify({
Title = "Emote Swapper",
Content = "All emotes have been restored to original names!",
Icon = "check-circle",
Duration = 3
})
else
WindUI:Notify({
Title = "Emote Swapper",
Content = "Failed to reset emotes!",
Icon = "x-circle",
Duration = 3
})
end
end
})
player.CharacterRemoving:Connect(function()
if next(EmoteSwapper.SwappedPairs) then
ResetEmoteNames()
end
end)
player.CharacterAdded:Connect(function(character)
task.wait(1)
if CheckIfPlayerDowned() then
return
end
if next(EmoteSwapper.SwappedPairs) then
for currentEmote, selectedEmote in pairs(EmoteSwapper.SwappedPairs) do
SwapEmoteNames(currentEmote, selectedEmote)
end
end
if EmoteSwapper.PendingApply and #EmoteSwapper.PendingSwaps > 0 then
swappedCount, failedCount = ProcessPendingSwaps()
message = ""
if swappedCount > 0 then
message = "Successfully swapped " .. tostring(swappedCount) .. " emote(s)"
end
if failedCount > 0 then
if message ~= "" then message = message .. " | " end
message = message .. "Failed to swap " .. tostring(failedCount) .. " emote(s)"
end
if message ~= "" then
WindUI:Notify({
Title = "Emote Swapper",
Content = message,
Icon = swappedCount > 0 and "check-circle" or "x-circle",
Duration = 3
})
end
end
end)
player.CharacterAdded:Connect(function(character)
task.wait(1)
if character:GetAttribute("Downed") then
return
end
if next(EmoteSwapper.SwappedPairs) then
for currentEmote, selectedEmote in pairs(EmoteSwapper.SwappedPairs) do
SwapEmoteNames(currentEmote, selectedEmote)
end
end
end)