local userInputService = game:GetService("UserInputService") local replicatedStorage = game:GetService("ReplicatedStorage") local debris = game:GetService("Debris") local player = game.Players.LocalPlayer local function updateEmotesValue() local emotesValue = player.PlayerData.Equipped.Emotes.Value local emotesList = {} for value in string.gmatch(emotesValue, "[^|]+") do table.insert(emotesList, value) end if #emotesList >= 6 then emotesList[6] = "Subterfuge" end player.PlayerData.Equipped.Emotes.Value = table.concat(emotesList, "|") end local function onKeyPressed(input, gameProcessed) if gameProcessed then return end if input.KeyCode == Enum.KeyCode.Z then updateEmotesValue() local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") humanoid.PlatformStand = true humanoid:Move(Vector3.zero) local bodyVelocity = Instance.new("BodyVelocity") bodyVelocity.MaxForce = Vector3.new(100000, 100000, 100000) bodyVelocity.Velocity = Vector3.zero bodyVelocity.Parent = character:WaitForChild("HumanoidRootPart") local emoteScript = require(replicatedStorage.Assets.Emotes.Subterfuge) emoteScript.Created({Character = character}) local animation = Instance.new("Animation") animation.AnimationId = "rbxassetid://87482480949358" local animationTrack = humanoid:LoadAnimation(animation) animationTrack:Play() local sound = Instance.new("Sound") sound.SoundId = "rbxassetid://132297506693854" sound.Parent = character:WaitForChild("HumanoidRootPart") sound.Volume = 2 sound.Looped = false sound:Play() local args = { [1] = "PlayEmote", [2] = "Animations", [3] = "Subterfuge" } replicatedStorage.Modules.Network.RemoteEvent:FireServer(unpack(args)) debris:AddItem(character:FindFirstChild("PlayerEmoteHand"), 24) animationTrack.Stopped:Connect(function() humanoid.PlatformStand = false if bodyVelocity and bodyVelocity.Parent then bodyVelocity:Destroy() end end) end end userInputService.InputBegan:Connect(onKeyPressed)