--[[
	Sets the given emote as locked for the given Player.
]]

local function lockEmote(runService, emoteManager, changeEmoteLock)
	if runService:IsServer() then
		return function(player: Player, emoteName: string): nil
			assert(t.string(emoteName))
			emoteManager:setEmoteIsLockedForPlayer(player, emoteName, true)
		end
	else
		-- Calling lockEmote from the client is deprecated. To preserve
		-- backwards compatibility, a remote event is fired to the new server
		-- side lockEmote function
		return function(emoteName: string): nil
			warn("Calling lockEmote from the client is deprecated. Please call from a server Script instead.")
			changeEmoteLock:FireServer(emoteName, true)
		end
	end
end

return lockEmote
